Skip to content

Commit 97d3b59

Browse files
committed
ci: rename unclear env vars
Signed-off-by: CrazyMax <[email protected]>
1 parent 9b63b37 commit 97d3b59

File tree

6 files changed

+50
-57
lines changed

6 files changed

+50
-57
lines changed

.github/workflows/.test.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@ on:
2727
type: string
2828

2929
env:
30-
REPO_SLUG_ORIGIN: "moby/buildkit:latest"
31-
TESTFLAGS: "-v --parallel=6 --timeout=30m"
32-
BUILDX_VERSION: "latest" # leave empty to use the one available on GitHub virtual environment
3330
GO_VERSION: "1.19"
31+
SETUP_BUILDX_VERSION: "latest"
32+
SETUP_BUILDKIT_IMAGE: "moby/buildkit:latest"
33+
TESTFLAGS: "-v --parallel=6 --timeout=30m"
3434

3535
jobs:
3636
prepare:
@@ -54,8 +54,8 @@ jobs:
5454
name: Set up Docker Buildx
5555
uses: docker/setup-buildx-action@v2
5656
with:
57-
version: ${{ env.BUILDX_VERSION }}
58-
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
57+
version: ${{ env.SETUP_BUILDX_VERSION }}
58+
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
5959
buildkitd-flags: --debug
6060
-
6161
name: Deps
@@ -135,8 +135,8 @@ jobs:
135135
name: Set up Docker Buildx
136136
uses: docker/setup-buildx-action@v2
137137
with:
138-
version: ${{ env.BUILDX_VERSION }}
139-
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
138+
version: ${{ env.SETUP_BUILDX_VERSION }}
139+
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
140140
buildkitd-flags: --debug
141141
-
142142
name: Test

.github/workflows/buildkit.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ on:
2020
- 'frontend/dockerfile/docs/**'
2121

2222
env:
23-
REPO_SLUG_ORIGIN: "moby/buildkit:latest"
24-
REPO_SLUG_TARGET: "moby/buildkit"
23+
GO_VERSION: "1.19"
24+
SETUP_BUILDX_VERSION: "latest"
25+
SETUP_BUILDKIT_IMAGE: "moby/buildkit:latest"
26+
IMAGE_NAME: "moby/buildkit"
2527
PLATFORMS: "linux/amd64,linux/arm/v7,linux/arm64,linux/s390x,linux/ppc64le,linux/riscv64"
2628
CACHE_GHA_SCOPE_BINARIES: "binaries"
2729
CACHE_GHA_SCOPE_CROSS: "cross"
28-
BUILDX_VERSION: "latest" # leave empty to use the one available on GitHub virtual environment
29-
GO_VERSION: "1.19"
3030

3131
jobs:
3232
base:
@@ -45,8 +45,8 @@ jobs:
4545
name: Set up Docker Buildx
4646
uses: docker/setup-buildx-action@v2
4747
with:
48-
version: ${{ env.BUILDX_VERSION }}
49-
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
48+
version: ${{ env.SETUP_BUILDX_VERSION }}
49+
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
5050
buildkitd-flags: --debug
5151
-
5252
name: Build ${{ env.CACHE_GHA_SCOPE_BINARIES }}
@@ -96,8 +96,8 @@ jobs:
9696
name: Set up Docker Buildx
9797
uses: docker/setup-buildx-action@v2
9898
with:
99-
version: ${{ env.BUILDX_VERSION }}
100-
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
99+
version: ${{ env.SETUP_BUILDX_VERSION }}
100+
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
101101
buildkitd-flags: --debug
102102
-
103103
name: Cross
@@ -159,8 +159,8 @@ jobs:
159159
name: Set up Docker Buildx
160160
uses: docker/setup-buildx-action@v2
161161
with:
162-
version: ${{ env.BUILDX_VERSION }}
163-
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
162+
version: ${{ env.SETUP_BUILDX_VERSION }}
163+
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
164164
buildkitd-flags: --debug
165165
-
166166
name: Login to DockerHub
@@ -172,7 +172,7 @@ jobs:
172172
-
173173
name: Build ${{ needs.release-base.outputs.tag }}
174174
run: |
175-
./hack/images "${{ needs.release-base.outputs.tag }}" "$REPO_SLUG_TARGET" "${{ needs.release-base.outputs.push }}"
175+
./hack/images "${{ needs.release-base.outputs.tag }}" "$IMAGE_NAME" "${{ needs.release-base.outputs.push }}"
176176
env:
177177
RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }}
178178
TARGET: ${{ matrix.target-stage }}
@@ -199,8 +199,8 @@ jobs:
199199
name: Set up Docker Buildx
200200
uses: docker/setup-buildx-action@v2
201201
with:
202-
version: ${{ env.BUILDX_VERSION }}
203-
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
202+
version: ${{ env.SETUP_BUILDX_VERSION }}
203+
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
204204
buildkitd-flags: --debug
205205
-
206206
name: Build ${{ needs.release-base.outputs.tag }}

.github/workflows/buildx-image.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ on:
3030
default: 'true'
3131

3232
env:
33+
SETUP_BUILDX_VERSION: "latest"
3334
REPO_SLUG_TARGET: "moby/buildkit"
34-
BUILDX_VERSION: "latest" # leave empty to use the one available on GitHub virtual environment
3535

3636
jobs:
3737
create:
@@ -47,7 +47,7 @@ jobs:
4747
name: Set up Docker Buildx
4848
uses: docker/setup-buildx-action@v2
4949
with:
50-
version: ${{ env.BUILDX_VERSION }}
50+
version: ${{ env.SETUP_BUILDX_VERSION }}
5151
buildkitd-flags: --debug
5252
-
5353
name: Login to DockerHub

.github/workflows/dockerd.yml

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,65 +7,58 @@ on:
77
version:
88
description: 'Docker version'
99
required: true
10-
default: '20.10.19'
10+
default: '23.0.1'
1111

1212
env:
13-
REPO_SLUG_ORIGIN: "moby/buildkit:latest"
13+
SETUP_BUILDX_VERSION: "latest"
14+
SETUP_BUILDKIT_IMAGE: "moby/buildkit:latest"
1415
CACHE_GHA_SCOPE_IT: "integration-tests"
1516
CACHE_GHA_SCOPE_BINARIES: "binaries"
1617
TESTFLAGS: "-v --parallel=1 --timeout=30m"
17-
BUILDX_VERSION: "latest" # leave empty to use the one available on GitHub virtual environment
1818

1919
jobs:
2020
prepare:
2121
runs-on: ubuntu-20.04
2222
steps:
2323
-
24-
name: Check version
25-
run: |
26-
version=${{ github.event.inputs.version }}
27-
if [ -z "$version" ]; then
28-
version=20.10.19
29-
fi
30-
echo "DOCKER_VERSION=$version" >> $GITHUB_ENV
31-
-
32-
name: Check build
24+
name: Prepare
3325
uses: actions/github-script@v6
34-
id: build
3526
with:
36-
result-encoding: string
3727
script: |
28+
const version = `${{ inputs.version }}` || '23.0.1';
29+
let build = 'true';
3830
try {
39-
new URL("${{ env.DOCKER_VERSION }}");
31+
new URL(version);
4032
} catch (e) {
41-
return false;
33+
build = 'false';
4234
}
43-
return true;
35+
core.exportVariable('DOCKER_VERSION', version);
36+
core.exportVariable('DOCKER_BUILD', build);
4437
-
4538
name: Set up Docker Buildx
4639
uses: docker/setup-buildx-action@v2
4740
with:
48-
version: ${{ env.BUILDX_VERSION }}
49-
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
41+
version: ${{ env.SETUP_BUILDX_VERSION }}
42+
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
5043
buildkitd-flags: --debug
5144
-
5245
name: Build
53-
if: steps.build.outputs.result == 'true'
46+
if: ${{ env.DOCKER_BUILD == 'true' }}
5447
uses: docker/build-push-action@v3
5548
with:
5649
context: ${{ env.DOCKER_VERSION }}
5750
target: binary
5851
outputs: /tmp/moby
5952
-
6053
name: Rename binary
61-
if: steps.build.outputs.result == 'true'
54+
if: ${{ env.DOCKER_BUILD == 'true' }}
6255
run: |
6356
if [ -L "/tmp/moby/binary-daemon/dockerd" ]; then
6457
mv -f $(readlink /tmp/moby/binary-daemon/dockerd) /tmp/moby/dockerd
6558
fi
6659
-
6760
name: Download
68-
if: steps.build.outputs.result != 'true'
61+
if: ${{ env.DOCKER_BUILD != 'true' }}
6962
run: |
7063
mkdir -p /tmp/moby
7164
cd /tmp/moby
@@ -113,8 +106,8 @@ jobs:
113106
name: Set up Docker Buildx
114107
uses: docker/setup-buildx-action@v2
115108
with:
116-
version: ${{ env.BUILDX_VERSION }}
117-
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
109+
version: ${{ env.SETUP_BUILDX_VERSION }}
110+
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
118111
buildkitd-flags: --debug
119112
-
120113
name: Download dockerd

.github/workflows/frontend.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ on:
1818
- 'frontend/dockerfile/docs/**'
1919

2020
env:
21-
REPO_SLUG_ORIGIN: "moby/buildkit:latest"
22-
REPO_SLUG_TARGET: "docker/dockerfile-upstream"
23-
PLATFORMS: "linux/386,linux/amd64,linux/arm/v7,linux/arm64,linux/mips,linux/mipsle,linux/mips64,linux/mips64le,linux/s390x,linux/ppc64le,linux/riscv64"
24-
BUILDX_VERSION: "latest" # leave empty to use the one available on GitHub virtual environment
2521
GO_VERSION: "1.19"
22+
SETUP_BUILDX_VERSION: "latest"
23+
SETUP_BUILDKIT_TAG: "moby/buildkit:latest"
24+
IMAGE_NAME: "docker/dockerfile-upstream"
25+
PLATFORMS: "linux/386,linux/amd64,linux/arm/v7,linux/arm64,linux/mips,linux/mipsle,linux/mips64,linux/mips64le,linux/s390x,linux/ppc64le,linux/riscv64"
2626

2727
jobs:
2828
test:
@@ -96,8 +96,8 @@ jobs:
9696
name: Set up Docker Buildx
9797
uses: docker/setup-buildx-action@v2
9898
with:
99-
version: ${{ env.BUILDX_VERSION }}
100-
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
99+
version: ${{ env.SETUP_BUILDX_VERSION }}
100+
driver-opts: image=${{ env.SETUP_BUILDKIT_TAG }}
101101
buildkitd-flags: --debug
102102
-
103103
name: Login to DockerHub
@@ -109,7 +109,7 @@ jobs:
109109
-
110110
name: Build
111111
run: |
112-
./frontend/dockerfile/cmd/dockerfile-frontend/hack/release "${{ needs.prepare.outputs.typ }}" "${{ matrix.tag }}" "$REPO_SLUG_TARGET" "${{ needs.prepare.outputs.push }}"
112+
./frontend/dockerfile/cmd/dockerfile-frontend/hack/release "${{ needs.prepare.outputs.typ }}" "${{ matrix.tag }}" "$IMAGE_NAME" "${{ needs.prepare.outputs.push }}"
113113
env:
114114
RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }}
115115
CACHE_FROM: type=gha,scope=${{ env.CACHE_SCOPE }}

.github/workflows/validate.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ on:
1515
pull_request:
1616

1717
env:
18-
REPO_SLUG_ORIGIN: "moby/buildkit:latest"
19-
BUILDX_VERSION: "latest" # leave empty to use the one available on GitHub virtual environment
18+
SETUP_BUILDX_VERSION: "latest"
19+
SETUP_BUILDKIT_IMAGE: "moby/buildkit:latest"
2020

2121
jobs:
2222
validate:
@@ -37,8 +37,8 @@ jobs:
3737
name: Set up Docker Buildx
3838
uses: docker/setup-buildx-action@v2
3939
with:
40-
version: ${{ env.BUILDX_VERSION }}
41-
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
40+
version: ${{ env.SETUP_BUILDX_VERSION }}
41+
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
4242
buildkitd-flags: --debug
4343
-
4444
name: Run

0 commit comments

Comments
 (0)