Skip to content

Commit

Permalink
ci: rename unclear env vars
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Feb 16, 2023
1 parent a9ac9e6 commit 3a458ac
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 57 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/.test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ on:
type: string

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

jobs:
prepare:
Expand All @@ -54,8 +54,8 @@ jobs:
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
version: ${{ env.BUILDX_VERSION }}
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Deps
Expand Down Expand Up @@ -135,8 +135,8 @@ jobs:
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
version: ${{ env.BUILDX_VERSION }}
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Test
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/buildkit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ on:
- 'frontend/dockerfile/docs/**'

env:
REPO_SLUG_ORIGIN: "moby/buildkit:latest"
REPO_SLUG_TARGET: "moby/buildkit"
GO_VERSION: "1.19"
SETUP_BUILDX_VERSION: "latest"
SETUP_BUILDKIT_IMAGE: "moby/buildkit:latest"
IMAGE_NAME: "moby/buildkit"
PLATFORMS: "linux/amd64,linux/arm/v7,linux/arm64,linux/s390x,linux/ppc64le,linux/riscv64"
CACHE_GHA_SCOPE_BINARIES: "binaries"
CACHE_GHA_SCOPE_CROSS: "cross"
BUILDX_VERSION: "latest" # leave empty to use the one available on GitHub virtual environment
GO_VERSION: "1.19"

jobs:
base:
Expand All @@ -45,8 +45,8 @@ jobs:
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
version: ${{ env.BUILDX_VERSION }}
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Build ${{ env.CACHE_GHA_SCOPE_BINARIES }}
Expand Down Expand Up @@ -96,8 +96,8 @@ jobs:
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
version: ${{ env.BUILDX_VERSION }}
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Cross
Expand Down Expand Up @@ -159,8 +159,8 @@ jobs:
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
version: ${{ env.BUILDX_VERSION }}
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Login to DockerHub
Expand All @@ -172,7 +172,7 @@ jobs:
-
name: Build ${{ needs.release-base.outputs.tag }}
run: |
./hack/images "${{ needs.release-base.outputs.tag }}" "$REPO_SLUG_TARGET" "${{ needs.release-base.outputs.push }}"
./hack/images "${{ needs.release-base.outputs.tag }}" "$IMAGE_NAME" "${{ needs.release-base.outputs.push }}"
env:
RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }}
TARGET: ${{ matrix.target-stage }}
Expand All @@ -199,8 +199,8 @@ jobs:
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
version: ${{ env.BUILDX_VERSION }}
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Build ${{ needs.release-base.outputs.tag }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/buildx-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ on:
default: 'true'

env:
SETUP_BUILDX_VERSION: "latest"
REPO_SLUG_TARGET: "moby/buildkit"
BUILDX_VERSION: "latest" # leave empty to use the one available on GitHub virtual environment

jobs:
create:
Expand All @@ -47,7 +47,7 @@ jobs:
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
version: ${{ env.BUILDX_VERSION }}
version: ${{ env.SETUP_BUILDX_VERSION }}
buildkitd-flags: --debug
-
name: Login to DockerHub
Expand Down
41 changes: 17 additions & 24 deletions .github/workflows/dockerd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,65 +7,58 @@ on:
version:
description: 'Docker version'
required: true
default: '20.10.19'
default: '23.0.1'

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

jobs:
prepare:
runs-on: ubuntu-20.04
steps:
-
name: Check version
run: |
version=${{ github.event.inputs.version }}
if [ -z "$version" ]; then
version=20.10.19
fi
echo "DOCKER_VERSION=$version" >> $GITHUB_ENV
-
name: Check build
name: Prepare
uses: actions/github-script@v6
id: build
with:
result-encoding: string
script: |
const version = `${{ inputs.version }}` || '23.0.1';
let build = 'true';
try {
new URL("${{ env.DOCKER_VERSION }}");
new URL(version);
} catch (e) {
return false;
build = 'false';
}
return true;
core.exportVariable('DOCKER_VERSION', version);
core.exportVariable('DOCKER_BUILD', build);
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
version: ${{ env.BUILDX_VERSION }}
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Build
if: steps.build.outputs.result == 'true'
if: ${{ env.DOCKER_BUILD == 'true' }}
uses: docker/build-push-action@v3
with:
context: ${{ env.DOCKER_VERSION }}
target: binary
outputs: /tmp/moby
-
name: Rename binary
if: steps.build.outputs.result == 'true'
if: ${{ env.DOCKER_BUILD == 'true' }}
run: |
if [ -L "/tmp/moby/binary-daemon/dockerd" ]; then
mv -f $(readlink /tmp/moby/binary-daemon/dockerd) /tmp/moby/dockerd
fi
-
name: Download
if: steps.build.outputs.result != 'true'
if: ${{ env.DOCKER_BUILD != 'true' }}
run: |
mkdir -p /tmp/moby
cd /tmp/moby
Expand Down Expand Up @@ -113,8 +106,8 @@ jobs:
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
version: ${{ env.BUILDX_VERSION }}
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Download dockerd
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ on:
- 'frontend/dockerfile/docs/**'

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

jobs:
test:
Expand Down Expand Up @@ -96,8 +96,8 @@ jobs:
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
version: ${{ env.BUILDX_VERSION }}
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_TAG }}
buildkitd-flags: --debug
-
name: Login to DockerHub
Expand All @@ -109,7 +109,7 @@ jobs:
-
name: Build
run: |
./frontend/dockerfile/cmd/dockerfile-frontend/hack/release "${{ needs.prepare.outputs.typ }}" "${{ matrix.tag }}" "$REPO_SLUG_TARGET" "${{ needs.prepare.outputs.push }}"
./frontend/dockerfile/cmd/dockerfile-frontend/hack/release "${{ needs.prepare.outputs.typ }}" "${{ matrix.tag }}" "$IMAGE_NAME" "${{ needs.prepare.outputs.push }}"
env:
RELEASE: ${{ startsWith(github.ref, 'refs/tags/v') }}
CACHE_FROM: type=gha,scope=${{ env.CACHE_SCOPE }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ on:
pull_request:

env:
REPO_SLUG_ORIGIN: "moby/buildkit:latest"
BUILDX_VERSION: "latest" # leave empty to use the one available on GitHub virtual environment
SETUP_BUILDX_VERSION: "latest"
SETUP_BUILDKIT_IMAGE: "moby/buildkit:latest"

jobs:
validate:
Expand All @@ -37,8 +37,8 @@ jobs:
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
version: ${{ env.BUILDX_VERSION }}
driver-opts: image=${{ env.REPO_SLUG_ORIGIN }}
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Run
Expand Down

0 comments on commit 3a458ac

Please sign in to comment.