Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kaznak committed Dec 14, 2023
1 parent 15c15ae commit 156b582
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 14 deletions.
23 changes: 13 additions & 10 deletions .github/generate-strategy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,36 @@ repository_with_trailing_slash=$1
jq '
. as $root |
{
dir: ($root.dir // $root.imgname + "/" + $root.variant),
imgtags: ($root.imgtags // [$root.variant])
dir: ($root.imgname + "/" + $root.variant),
imgtags: [$root.variant]
} as $tmp |
{
platforms: ($root.platforms // ["linux/amd64"]),
imgtags: $tmp.imgtags,
tags: ($tmp.imgtags | map("'$repository_with_trailing_slash'\($root.imgname):\(.)")),
tags: (($root.imgtags // $tmp.imgtags) | map("'$repository_with_trailing_slash'\($root.imgname):\(.)")),
platforms: ($root.platforms // ["linux/amd64"]),
dir: $tmp.dir,
files: {
dockerfile: ($tmp.dir + "/Dockerfile"),
dockleignore: ($tmp.dir + "/.dockleignore")
dockerfile: "Dockerfile",
dockleignore: ".dockleignore"
},
buildArgs: {}
} as $defaults |
.platforms // $defaults.platforms | .[] | . as $platform |
{
name: $root.name,
variant: $root.variant,
platform: $platform,
imgname: $root.imgname,
imgtags: $defaults.imgtags,
variant: $root.variant,
imgtags: ($root.imgtags // $defaults.imgtags),
tags: ($root.tags // $defaults.tags),
platforms: ($root.platforms // $defaults.platforms),
dir: ($root.dir // $defaults.dir),
files: {
dockerfile: ($root.files.dockerfile // $defaults.files.dockerfile),
dockleignore: ($root.files.dockleignore // $defaults.files.dockleignore)
},
filesProcessed: {
dockerfile: (($root.dir // $defaults.dir) + "/" + ($root.files.dockerfile // $defaults.files.dockerfile)),
dockleignore: (($root.dir // $defaults.dir) + "/" + ($root.files.dockleignore // $defaults.files.dockleignore))
},
buildArgs: ($root.buildArgs // $defaults.buildArgs),
buildArgsProcessed: (($root.buildArgs // $defaults.buildArgs) | to_entries | map("\(.key)=\(.value)") | join("\n"))
}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ jobs:
uses: docker/build-push-action@v5
with:
context: ${{ matrix.dir }}
file: ${{ matrix.file }}
file: ${{ matrix.filesProcessed }}
push: false
load: true
tags: ${{ join(matrix.tags) }}
build-args: ${{ matrix.buildArgsProcessed }}

- name: Setup dockle
env:
dockleignore: ${{ matrix.files.dockleignore }}
dockleignore: ${{ matrix.filesProcessed.dockleignore }}
run: |
cp $dockleignore .
Expand All @@ -89,8 +89,8 @@ jobs:
uses: docker/build-push-action@v5
with:
context: ${{ matrix.dir }}
file: ${{ matrix.files.dockerfile }}
platforms: ${{ matrix.platforms }}
file: ${{ matrix.filesProcessed.dockerfile }}
platforms: ${{ join(matrix.platforms) }}
push: true
tags: ${{ join(matrix.tags) }}
build-args: ${{ matrix.buildArgsProcessed }}

0 comments on commit 156b582

Please sign in to comment.