Skip to content

Commit

Permalink
⚡ Revise build command for multiplatforms
Browse files Browse the repository at this point in the history
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
  • Loading branch information
rinx committed Dec 23, 2020
1 parent 015bfb3 commit db9df0b
Show file tree
Hide file tree
Showing 19 changed files with 257 additions and 126 deletions.
21 changes: 14 additions & 7 deletions .github/workflows/dockers-agent-ngt-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,17 @@ jobs:
id: image_name
run: |
image_name=`make docker/name/agent-ngt`
alter_repo=`make docker/name/repo/alter`
alter_image_name=`make REPO="${alter_repo}" docker/name/agent-ngt`
base_platforms=`make docker/platforms`
echo "IMAGE_NAME=${image_name}" >> $GITHUB_ENV
echo "ALTER_IMAGE_NAME=${alter_image_name}" >> $GITHUB_ENV
echo "::set-output name=IMAGE_NAME::${image_name}"
echo "::set-output name=BASE_PLATFORMS::${base_platforms}"
- name: Determine tag name (master)
if: github.ref == 'refs/heads/master'
run: |
echo "nightly" > versions/VALD_VERSION
echo "PRIMARY_TAG=nightly" >> $GITHUB_ENV
echo "PLATFORMS=${PLATFORMS}" >> $GITHUB_ENV
env:
Expand All @@ -104,17 +108,20 @@ jobs:
echo "PLATFORMS=${PLATFORMS}" >> $GITHUB_ENV
env:
PLATFORMS: ${{ steps.image_name.outputs.BASE_PLATFORMS }}
- name: Add extra tags
run: |
EXTRA_TAGS="-t ${ALTER_IMAGE_NAME}:${PRIMARY_TAG}"
echo "EXTRA_TAGS=${EXTRA_TAGS}" >> $GITHUB_ENV
- name: Add latest tags
if: startsWith( github.ref, 'refs/tags/')
run: |
LATEST_TAGS="-t ${IMAGE_NAME}:latest -t ${ALTER_IMAGE_NAME}:latest"
echo "LATEST_TAGS=${LATEST_TAGS}" >> $GITHUB_ENV
- name: Build and Push
run: |
make \
DOCKER="docker buildx" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} --push" \
TAG="${PRIMARY_TAG}" \
docker/build/agent-ngt
make \
REPO="ghcr.io/vdaas/vald" \
DOCKER="docker buildx" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} --push" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} ${EXTRA_TAGS} ${LATEST_TAGS} --push" \
TAG="${PRIMARY_TAG}" \
docker/build/agent-ngt
env:
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/dockers-agent-sidecar-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,17 @@ jobs:
id: image_name
run: |
image_name=`make docker/name/agent-sidecar`
alter_repo=`make docker/name/repo/alter`
alter_image_name=`make REPO="${alter_repo}" docker/name/agent-sidecar`
base_platforms=`make docker/platforms`
echo "IMAGE_NAME=${image_name}" >> $GITHUB_ENV
echo "ALTER_IMAGE_NAME=${alter_image_name}" >> $GITHUB_ENV
echo "::set-output name=IMAGE_NAME::${image_name}"
echo "::set-output name=BASE_PLATFORMS::${base_platforms}"
- name: Determine tag name (master)
if: github.ref == 'refs/heads/master'
run: |
echo "nightly" > versions/VALD_VERSION
echo "PRIMARY_TAG=nightly" >> $GITHUB_ENV
echo "PLATFORMS=${PLATFORMS}" >> $GITHUB_ENV
env:
Expand All @@ -104,17 +108,20 @@ jobs:
echo "PLATFORMS=${PLATFORMS}" >> $GITHUB_ENV
env:
PLATFORMS: ${{ steps.image_name.outputs.BASE_PLATFORMS }}
- name: Add extra tags
run: |
EXTRA_TAGS="-t ${ALTER_IMAGE_NAME}:${PRIMARY_TAG}"
echo "EXTRA_TAGS=${EXTRA_TAGS}" >> $GITHUB_ENV
- name: Add latest tags
if: startsWith( github.ref, 'refs/tags/')
run: |
LATEST_TAGS="-t ${IMAGE_NAME}:latest -t ${ALTER_IMAGE_NAME}:latest"
echo "LATEST_TAGS=${LATEST_TAGS}" >> $GITHUB_ENV
- name: Build and Push
run: |
make \
DOCKER="docker buildx" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} --push" \
TAG="${PRIMARY_TAG}" \
docker/build/agent-sidecar
make \
REPO="ghcr.io/vdaas/vald" \
DOCKER="docker buildx" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} --push" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} ${EXTRA_TAGS} ${LATEST_TAGS} --push" \
TAG="${PRIMARY_TAG}" \
docker/build/agent-sidecar
env:
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/dockers-backup-manager-cassandra-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,17 @@ jobs:
id: image_name
run: |
image_name=`make docker/name/backup-manager-cassandra`
alter_repo=`make docker/name/repo/alter`
alter_image_name=`make REPO="${alter_repo}" docker/name/backup-manager-cassandra`
base_platforms=`make docker/platforms`
echo "IMAGE_NAME=${image_name}" >> $GITHUB_ENV
echo "ALTER_IMAGE_NAME=${alter_image_name}" >> $GITHUB_ENV
echo "::set-output name=IMAGE_NAME::${image_name}"
echo "::set-output name=BASE_PLATFORMS::${base_platforms}"
- name: Determine tag name (master)
if: github.ref == 'refs/heads/master'
run: |
echo "nightly" > versions/VALD_VERSION
echo "PRIMARY_TAG=nightly" >> $GITHUB_ENV
echo "PLATFORMS=${PLATFORMS}" >> $GITHUB_ENV
env:
Expand All @@ -106,17 +110,20 @@ jobs:
echo "PLATFORMS=${PLATFORMS}" >> $GITHUB_ENV
env:
PLATFORMS: ${{ steps.image_name.outputs.BASE_PLATFORMS }}
- name: Add extra tags
run: |
EXTRA_TAGS="-t ${ALTER_IMAGE_NAME}:${PRIMARY_TAG}"
echo "EXTRA_TAGS=${EXTRA_TAGS}" >> $GITHUB_ENV
- name: Add latest tags
if: startsWith( github.ref, 'refs/tags/')
run: |
LATEST_TAGS="-t ${IMAGE_NAME}:latest -t ${ALTER_IMAGE_NAME}:latest"
echo "LATEST_TAGS=${LATEST_TAGS}" >> $GITHUB_ENV
- name: Build and Push
run: |
make \
DOCKER="docker buildx" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} --push" \
TAG="${PRIMARY_TAG}" \
docker/build/backup-manager-cassandra
make \
REPO="ghcr.io/vdaas/vald" \
DOCKER="docker buildx" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} --push" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} ${EXTRA_TAGS} ${LATEST_TAGS} --push" \
TAG="${PRIMARY_TAG}" \
docker/build/backup-manager-cassandra
env:
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/dockers-backup-manager-mysql-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,17 @@ jobs:
id: image_name
run: |
image_name=`make docker/name/backup-manager-mysql`
alter_repo=`make docker/name/repo/alter`
alter_image_name=`make REPO="${alter_repo}" docker/name/backup-manager-mysql`
base_platforms=`make docker/platforms`
echo "IMAGE_NAME=${image_name}" >> $GITHUB_ENV
echo "ALTER_IMAGE_NAME=${alter_image_name}" >> $GITHUB_ENV
echo "::set-output name=IMAGE_NAME::${image_name}"
echo "::set-output name=BASE_PLATFORMS::${base_platforms}"
- name: Determine tag name (master)
if: github.ref == 'refs/heads/master'
run: |
echo "nightly" > versions/VALD_VERSION
echo "PRIMARY_TAG=nightly" >> $GITHUB_ENV
echo "PLATFORMS=${PLATFORMS}" >> $GITHUB_ENV
env:
Expand All @@ -104,17 +108,20 @@ jobs:
echo "PLATFORMS=${PLATFORMS}" >> $GITHUB_ENV
env:
PLATFORMS: ${{ steps.image_name.outputs.BASE_PLATFORMS }}
- name: Add extra tags
run: |
EXTRA_TAGS="-t ${ALTER_IMAGE_NAME}:${PRIMARY_TAG}"
echo "EXTRA_TAGS=${EXTRA_TAGS}" >> $GITHUB_ENV
- name: Add latest tags
if: startsWith( github.ref, 'refs/tags/')
run: |
LATEST_TAGS="-t ${IMAGE_NAME}:latest -t ${ALTER_IMAGE_NAME}:latest"
echo "LATEST_TAGS=${LATEST_TAGS}" >> $GITHUB_ENV
- name: Build and Push
run: |
make \
DOCKER="docker buildx" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} --push" \
TAG="${PRIMARY_TAG}" \
docker/build/backup-manager-mysql
make \
REPO="ghcr.io/vdaas/vald" \
DOCKER="docker buildx" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} --push" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} ${EXTRA_TAGS} ${LATEST_TAGS} --push" \
TAG="${PRIMARY_TAG}" \
docker/build/backup-manager-mysql
env:
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/dockers-base-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,11 @@ jobs:
id: image_name
run: |
image_name=`make docker/name/base`
alter_repo=`make docker/name/repo/alter`
alter_image_name=`make REPO="${alter_repo}" docker/name/base`
base_platforms=`make docker/platforms`
echo "IMAGE_NAME=${image_name}" >> $GITHUB_ENV
echo "ALTER_IMAGE_NAME=${alter_image_name}" >> $GITHUB_ENV
echo "::set-output name=IMAGE_NAME::${image_name}"
echo "::set-output name=BASE_PLATFORMS::${base_platforms}"
- name: Determine tag name (master)
Expand All @@ -74,17 +77,20 @@ jobs:
tag_name=`echo $GITHUB_REF | sed -e 's:^refs/tags/::'`
echo "::set-output name=TAG_NAME::${tag_name}"
echo "PRIMARY_TAG=${tag_name}" >> $GITHUB_ENV
- name: Add extra tags
run: |
EXTRA_TAGS="-t ${ALTER_IMAGE_NAME}:${PRIMARY_TAG}"
echo "EXTRA_TAGS=${EXTRA_TAGS}" >> $GITHUB_ENV
- name: Add latest tags
if: startsWith( github.ref, 'refs/tags/')
run: |
LATEST_TAGS="-t ${IMAGE_NAME}:latest -t ${ALTER_IMAGE_NAME}:latest"
echo "LATEST_TAGS=${LATEST_TAGS}" >> $GITHUB_ENV
- name: Build and Push
run: |
make \
DOCKER="docker buildx" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} --push" \
TAG="${PRIMARY_TAG}" \
docker/build/base
make \
REPO="ghcr.io/vdaas/vald" \
DOCKER="docker buildx" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} --push" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} ${EXTRA_TAGS} ${LATEST_TAGS} --push" \
TAG="${PRIMARY_TAG}" \
docker/build/base
env:
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/dockers-ci-container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ jobs:
id: image_name
run: |
image_name=`make docker/name/ci-container`
alter_repo=`make docker/name/repo/alter`
alter_image_name=`make REPO="${alter_repo}" docker/name/ci-container`
echo "IMAGE_NAME=${image_name}" >> $GITHUB_ENV
echo "ALTER_IMAGE_NAME=${alter_image_name}" >> $GITHUB_ENV
echo "::set-output name=IMAGE_NAME::${image_name}"
- name: Determine tag name (master)
if: github.ref == 'refs/heads/master'
Expand All @@ -68,17 +71,20 @@ jobs:
tag_name=`echo $GITHUB_REF | sed -e 's:^refs/tags/::'`
echo "::set-output name=TAG_NAME::${tag_name}"
echo "PRIMARY_TAG=${tag_name}" >> $GITHUB_ENV
- name: Add extra tags
run: |
EXTRA_TAGS="-t ${ALTER_IMAGE_NAME}:${PRIMARY_TAG}"
echo "EXTRA_TAGS=${EXTRA_TAGS}" >> $GITHUB_ENV
- name: Add latest tags
if: startsWith( github.ref, 'refs/tags/')
run: |
LATEST_TAGS="-t ${IMAGE_NAME}:latest -t ${ALTER_IMAGE_NAME}:latest"
echo "LATEST_TAGS=${LATEST_TAGS}" >> $GITHUB_ENV
- name: Build and Push
run: |
make \
DOCKER="docker buildx" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} --push" \
TAG="${PRIMARY_TAG}" \
docker/build/ci-container
make \
REPO="ghcr.io/vdaas/vald" \
DOCKER="docker buildx" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} --push" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} ${EXTRA_TAGS} ${LATEST_TAGS} --push" \
TAG="${PRIMARY_TAG}" \
docker/build/ci-container
env:
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/dockers-dev-container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ jobs:
id: image_name
run: |
image_name=`make docker/name/dev-container`
alter_repo=`make docker/name/repo/alter`
alter_image_name=`make REPO="${alter_repo}" docker/name/dev-container`
echo "IMAGE_NAME=${image_name}" >> $GITHUB_ENV
echo "ALTER_IMAGE_NAME=${alter_image_name}" >> $GITHUB_ENV
echo "::set-output name=IMAGE_NAME::${image_name}"
- name: Determine tag name (master)
if: github.ref == 'refs/heads/master'
Expand All @@ -68,17 +71,20 @@ jobs:
tag_name=`echo $GITHUB_REF | sed -e 's:^refs/tags/::'`
echo "::set-output name=TAG_NAME::${tag_name}"
echo "PRIMARY_TAG=${tag_name}" >> $GITHUB_ENV
- name: Add extra tags
run: |
EXTRA_TAGS="-t ${ALTER_IMAGE_NAME}:${PRIMARY_TAG}"
echo "EXTRA_TAGS=${EXTRA_TAGS}" >> $GITHUB_ENV
- name: Add latest tags
if: startsWith( github.ref, 'refs/tags/')
run: |
LATEST_TAGS="-t ${IMAGE_NAME}:latest -t ${ALTER_IMAGE_NAME}:latest"
echo "LATEST_TAGS=${LATEST_TAGS}" >> $GITHUB_ENV
- name: Build and Push
run: |
make \
DOCKER="docker buildx" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} --push" \
TAG="${PRIMARY_TAG}" \
docker/build/dev-container
make \
REPO="ghcr.io/vdaas/vald" \
DOCKER="docker buildx" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} --push" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} ${EXTRA_TAGS} ${LATEST_TAGS} --push" \
TAG="${PRIMARY_TAG}" \
docker/build/dev-container
env:
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/dockers-discoverer-k8s-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,17 @@ jobs:
id: image_name
run: |
image_name=`make docker/name/discoverer-k8s`
alter_repo=`make docker/name/repo/alter`
alter_image_name=`make REPO="${alter_repo}" docker/name/discoverer-k8s`
base_platforms=`make docker/platforms`
echo "IMAGE_NAME=${image_name}" >> $GITHUB_ENV
echo "ALTER_IMAGE_NAME=${alter_image_name}" >> $GITHUB_ENV
echo "::set-output name=IMAGE_NAME::${image_name}"
echo "::set-output name=BASE_PLATFORMS::${base_platforms}"
- name: Determine tag name (master)
if: github.ref == 'refs/heads/master'
run: |
echo "nightly" > versions/VALD_VERSION
echo "PRIMARY_TAG=nightly" >> $GITHUB_ENV
echo "PLATFORMS=${PLATFORMS}" >> $GITHUB_ENV
env:
Expand All @@ -100,17 +104,20 @@ jobs:
echo "PLATFORMS=${PLATFORMS}" >> $GITHUB_ENV
env:
PLATFORMS: ${{ steps.image_name.outputs.BASE_PLATFORMS }}
- name: Add extra tags
run: |
EXTRA_TAGS="-t ${ALTER_IMAGE_NAME}:${PRIMARY_TAG}"
echo "EXTRA_TAGS=${EXTRA_TAGS}" >> $GITHUB_ENV
- name: Add latest tags
if: startsWith( github.ref, 'refs/tags/')
run: |
LATEST_TAGS="-t ${IMAGE_NAME}:latest -t ${ALTER_IMAGE_NAME}:latest"
echo "LATEST_TAGS=${LATEST_TAGS}" >> $GITHUB_ENV
- name: Build and Push
run: |
make \
DOCKER="docker buildx" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} --push" \
TAG="${PRIMARY_TAG}" \
docker/build/discoverer-k8s
make \
REPO="ghcr.io/vdaas/vald" \
DOCKER="docker buildx" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} --push" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} ${EXTRA_TAGS} ${LATEST_TAGS} --push" \
TAG="${PRIMARY_TAG}" \
docker/build/discoverer-k8s
env:
Expand Down
21 changes: 14 additions & 7 deletions .github/workflows/dockers-gateway-backup-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,17 @@ jobs:
id: image_name
run: |
image_name=`make docker/name/gateway-backup`
alter_repo=`make docker/name/repo/alter`
alter_image_name=`make REPO="${alter_repo}" docker/name/gateway-backup`
base_platforms=`make docker/platforms`
echo "IMAGE_NAME=${image_name}" >> $GITHUB_ENV
echo "ALTER_IMAGE_NAME=${alter_image_name}" >> $GITHUB_ENV
echo "::set-output name=IMAGE_NAME::${image_name}"
echo "::set-output name=BASE_PLATFORMS::${base_platforms}"
- name: Determine tag name (master)
if: github.ref == 'refs/heads/master'
run: |
echo "nightly" > versions/VALD_VERSION
echo "PRIMARY_TAG=nightly" >> $GITHUB_ENV
echo "PLATFORMS=${PLATFORMS}" >> $GITHUB_ENV
env:
Expand All @@ -106,17 +110,20 @@ jobs:
echo "PLATFORMS=${PLATFORMS}" >> $GITHUB_ENV
env:
PLATFORMS: ${{ steps.image_name.outputs.BASE_PLATFORMS }}
- name: Add extra tags
run: |
EXTRA_TAGS="-t ${ALTER_IMAGE_NAME}:${PRIMARY_TAG}"
echo "EXTRA_TAGS=${EXTRA_TAGS}" >> $GITHUB_ENV
- name: Add latest tags
if: startsWith( github.ref, 'refs/tags/')
run: |
LATEST_TAGS="-t ${IMAGE_NAME}:latest -t ${ALTER_IMAGE_NAME}:latest"
echo "LATEST_TAGS=${LATEST_TAGS}" >> $GITHUB_ENV
- name: Build and Push
run: |
make \
DOCKER="docker buildx" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} --push" \
TAG="${PRIMARY_TAG}" \
docker/build/gateway-backup
make \
REPO="ghcr.io/vdaas/vald" \
DOCKER="docker buildx" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} --push" \
DOCKER_OPTS="--platform ${PLATFORMS} --builder ${BUILDER} ${CACHE_OPTS} ${LABEL_OPTS} ${EXTRA_TAGS} ${LATEST_TAGS} --push" \
TAG="${PRIMARY_TAG}" \
docker/build/gateway-backup
env:
Expand Down
Loading

0 comments on commit db9df0b

Please sign in to comment.