Skip to content

Commit 122fa29

Browse files
committed
Use single output dir
1 parent 88ef574 commit 122fa29

File tree

7 files changed

+25
-29
lines changed

7 files changed

+25
-29
lines changed

.dockerignore

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1 @@
1-
/.idea
2-
/*.iml
3-
4-
/.dev
51
/bin
6-
/dist
7-
/release
8-
/site
9-
/coverage.txt

.github/workflows/build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515
env:
1616
DOCKERHUB_SLUG: crazymax/undock
1717
GHCR_SLUG: ghcr.io/${{ github.repository }}
18+
DESTDIR: ./bin
1819

1920
jobs:
2021
validate:
@@ -54,7 +55,7 @@ jobs:
5455
name: Upload coverage
5556
uses: codecov/codecov-action@v3
5657
with:
57-
file: ./coverage.txt
58+
directory: ${{ env.DESTDIR }}/coverage
5859

5960
build:
6061
runs-on: ubuntu-latest
@@ -121,7 +122,7 @@ jobs:
121122
uses: actions/upload-artifact@v3
122123
with:
123124
name: undock
124-
path: ./release/*
125+
path: ${{ env.DESTDIR }}/release/*
125126
if-no-files-found: error
126127
-
127128
name: Build image
@@ -140,7 +141,7 @@ jobs:
140141
with:
141142
draft: true
142143
files: |
143-
release/*
144+
${{ env.DESTDIR }}/release/*
144145
env:
145146
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
146147
-

.github/workflows/docs.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
- 'v*'
1212
pull_request:
1313

14+
env:
15+
DESTDIR: ./bin
16+
1417
jobs:
1518
publish:
1619
runs-on: ubuntu-latest
@@ -39,7 +42,7 @@ jobs:
3942
uses: crazy-max/ghaction-github-pages@v3
4043
with:
4144
target_branch: gh-pages
42-
build_dir: site
45+
build_dir: ${{ env.DESTDIR }}/site
4346
jekyll: false
4447
env:
4548
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/e2e.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
- '**.md'
1414
pull_request:
1515

16+
env:
17+
DESTDIR: ./bin
18+
1619
jobs:
1720
registry:
1821
runs-on: ubuntu-latest
@@ -63,7 +66,7 @@ jobs:
6366
flags="${flags} --include ${{ matrix.include }}"
6467
fi
6568
set -x
66-
./bin/undock ${flags} ${{ matrix.image }} ./dist
69+
${{ env.DESTDIR }}/build/undock ${flags} ${{ matrix.image }} ./dist
6770
-
6871
name: Dist content
6972
run: |
@@ -101,7 +104,7 @@ jobs:
101104
-
102105
name: Run
103106
run: |
104-
./bin/undock --rm-dist --include /hello docker-daemon://image:local ./dist
107+
${{ env.DESTDIR }}/build/undock --rm-dist --include /hello docker-daemon://image:local ./dist
105108
-
106109
name: Dist content
107110
run: |
@@ -129,7 +132,7 @@ jobs:
129132
-
130133
name: Run
131134
run: |
132-
./bin/undock --rm-dist docker-archive://archive.tar ./dist
135+
${{ env.DESTDIR }}/build/undock --rm-dist docker-archive://archive.tar ./dist
133136
-
134137
name: Dist content
135138
run: |

.gitignore

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1 @@
1-
/.idea
2-
/*.iml
3-
4-
/.dev
51
/bin
6-
/dist
7-
/release
8-
/coverage.txt

docker-bake.hcl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ variable "GO_VERSION" {
22
default = "1.19"
33
}
44

5+
variable "DESTDIR" {
6+
default = "./bin"
7+
}
8+
59
# GITHUB_REF is the actual ref that triggers the workflow and used as version
610
# when tag is pushed! https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
711
variable "GITHUB_REF" {
@@ -27,13 +31,13 @@ group "default" {
2731
target "binary" {
2832
inherits = ["_common"]
2933
target = "binary"
30-
output = ["./bin"]
34+
output = ["${DESTDIR}/build"]
3135
}
3236

3337
target "artifact" {
3438
inherits = ["_common"]
3539
target = "artifact"
36-
output = ["./dist"]
40+
output = ["${DESTDIR}/artifact"]
3741
}
3842

3943
target "artifact-all" {
@@ -56,9 +60,9 @@ target "artifact-all" {
5660

5761
target "release" {
5862
target = "release"
59-
output = ["./release"]
63+
output = ["${DESTDIR}/release"]
6064
contexts = {
61-
artifacts = "./dist"
65+
artifacts = "${DESTDIR}/artifact"
6266
}
6367
}
6468

@@ -86,7 +90,7 @@ target "image-all" {
8690
target "test" {
8791
inherits = ["_common"]
8892
target = "test-coverage"
89-
output = ["."]
93+
output = ["${DESTDIR}/coverage"]
9094
}
9195

9296
target "vendor" {
@@ -106,7 +110,7 @@ target "gomod-outdated" {
106110
target "docs" {
107111
dockerfile = "./hack/docs.Dockerfile"
108112
target = "release"
109-
output = ["./site"]
113+
output = ["${DESTDIR}/site"]
110114
}
111115

112116
group "validate" {

docs/build.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ cd undock
1010
# build docker image and output to docker with undock:local tag (default)
1111
docker buildx bake
1212

13-
# build binary in ./bin/undock
13+
# build binary in ./bin/build/undock
1414
docker buildx bake binary
1515

1616
# build artifact

0 commit comments

Comments
 (0)