update build and scheduled jobs for ARM

This commit is contained in:
Matthew McClaskey 2021-10-27 18:53:46 +00:00
parent 51bcae5f67
commit d7df24064f

View File

@ -18,24 +18,28 @@ before_script:
# Jobs for the develop and release branches. They should push to the private and public repos # Jobs for the develop and release branches. They should push to the private and public repos
build: build:
stage: build stage: build
image: kasmweb/docker-buildx-private:develop
script: script:
- BUILD_PLATFORM=$PLATFORM
- if [[ "${ARM_BUILDS}" == *",${KASM_IMAGE},"* ]]; then BUILD_PLATFORM="linux/amd64,linux/arm64"; fi;
- echo "Building ${KASM_IMAGE} for platforms ${BUILD_PLATFORM}"
# to get qemu ready
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
# to prepare the buildx env
- docker buildx create --use
# Ensure readme and description files are present # Ensure readme and description files are present
- ls docs/$KASM_IMAGE/README.md - ls docs/$KASM_IMAGE/README.md
- ls docs/$KASM_IMAGE/description.txt - ls docs/$KASM_IMAGE/description.txt
- docker build -t ${ORG_NAME}/$KASM_IMAGE:$SANITIZED_BRANCH -t ${ORG_NAME}/$KASM_IMAGE:$SANITIZED_ROLLING_BRANCH -t ${ORG_NAME}/$KASM_IMAGE-private:$SANITIZED_BRANCH -t ${ORG_NAME}/$KASM_IMAGE-private:$SANITIZED_ROLLING_BRANCH -f dockerfile-kasm-$KASM_IMAGE --build-arg BASE_TAG="develop" . - docker buildx build --push --platform $BUILD_PLATFORM -t ${ORG_NAME}/$KASM_IMAGE:$SANITIZED_BRANCH -t ${ORG_NAME}/$KASM_IMAGE:$SANITIZED_ROLLING_BRANCH -t ${ORG_NAME}/$KASM_IMAGE-private:$SANITIZED_BRANCH -t ${ORG_NAME}/$KASM_IMAGE-private:$SANITIZED_ROLLING_BRANCH --build-arg BASE_TAG="develop" -f dockerfile-kasm-$KASM_IMAGE .
- docker push ${ORG_NAME}/$KASM_IMAGE:$SANITIZED_BRANCH
- docker push ${ORG_NAME}/$KASM_IMAGE:$SANITIZED_ROLLING_BRANCH
- docker push ${ORG_NAME}/$KASM_IMAGE-private:$SANITIZED_BRANCH
- docker push ${ORG_NAME}/$KASM_IMAGE-private:$SANITIZED_ROLLING_BRANCH
only: only:
- develop - develop
- /^release\/.*$/ - /^release\/.*$/
except: except:
- schedules - schedules
tags:
- aws-autoscale
parallel: parallel:
matrix: matrix:
- KASM_IMAGE: [chrome, chromium, firefox, desktop, desktop-deluxe, firefox-mobile, tor-browser, doom, edge, terminal, vmware-horizon, remmina, rdesktop, brave, discord, sublime-text, gimp, vs-code, slack, teams, only-office, zoom, signal, steam, postman, insomnia, zsnes, vlc, ubuntu-bionic-desktop, maltego, centos-7-desktop, telegram ] - KASM_IMAGE: [chrome, chromium, firefox, desktop, desktop-deluxe, firefox-mobile, tor-browser, doom, edge, terminal, vmware-horizon, remmina, rdesktop, brave, discord, sublime-text, gimp, vs-code, slack, teams, only-office, zoom, signal, steam, postman, insomnia, zsnes, vlc, ubuntu-bionic-desktop, maltego, centos-7-desktop, telegram ]
@ -75,18 +79,26 @@ build_dev:
# These jobs are for the "rolling" release of the images. They should only run for scheduled jobs and should only push the rolling tags # These jobs are for the "rolling" release of the images. They should only run for scheduled jobs and should only push the rolling tags
build_schedules: build_schedules:
image: kasmweb/docker-buildx-private:develop
stage: build stage: build
script: script:
- BUILD_PLATFORM=$PLATFORM
- if [[ "${ARM_BUILDS}" == *",${KASM_IMAGE},"* ]]; then BUILD_PLATFORM="linux/amd64,linux/arm64"; fi;
- echo "Building ${KASM_IMAGE} for platforms ${BUILD_PLATFORM}"
# to get qemu ready
- docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
# to prepare the buildx env
- docker buildx create --use
# Ensure readme and description files are present # Ensure readme and description files are present
- ls docs/$KASM_IMAGE/README.md - ls docs/$KASM_IMAGE/README.md
- ls docs/$KASM_IMAGE/description.txt - ls docs/$KASM_IMAGE/description.txt
# Equivilant to docker build and docker push. Builds amd64 natively uses qemu for arm64.
- docker build -t ${ORG_NAME}/$KASM_IMAGE:$SANITIZED_ROLLING_BRANCH -t ${ORG_NAME}/$KASM_IMAGE-private:$SANITIZED_ROLLING_BRANCH -f dockerfile-kasm-$KASM_IMAGE --build-arg BASE_TAG="$SANITIZED_ROLLING_BRANCH" . # The only way to push multiple architectures to the same tag is to use buildx.
- docker buildx build --push --platform $BUILD_PLATFORM -t ${ORG_NAME}/$KASM_IMAGE:$SANITIZED_ROLLING_BRANCH -t ${ORG_NAME}/$KASM_IMAGE-private:$SANITIZED_ROLLING_BRANCH --build-arg BASE_TAG="$SANITIZED_ROLLING_BRANCH" -f dockerfile-kasm-$KASM_IMAGE .
- docker push ${ORG_NAME}/$KASM_IMAGE:$SANITIZED_ROLLING_BRANCH
- docker push ${ORG_NAME}/$KASM_IMAGE-private:$SANITIZED_ROLLING_BRANCH
only: only:
- schedules - schedules
tags:
- aws-autoscale
parallel: parallel:
matrix: matrix:
- KASM_IMAGE: [chrome, chromium, firefox, desktop, desktop-deluxe, firefox-mobile, tor-browser, doom, edge, terminal, vmware-horizon, remmina, rdesktop, brave, discord, sublime-text, gimp, vs-code, slack, teams, only-office, zoom, signal, steam, postman, insomnia, zsnes, vlc, ubuntu-bionic-desktop, maltego, centos-7-desktop, telegram ] - KASM_IMAGE: [chrome, chromium, firefox, desktop, desktop-deluxe, firefox-mobile, tor-browser, doom, edge, terminal, vmware-horizon, remmina, rdesktop, brave, discord, sublime-text, gimp, vs-code, slack, teams, only-office, zoom, signal, steam, postman, insomnia, zsnes, vlc, ubuntu-bionic-desktop, maltego, centos-7-desktop, telegram ]