Add multi-architecture Docker image build

* Adds a shell script with functions to install multi-architecture docker
  support, as well as build, deploy, and test the shellcheck docker images for
  the same set of architectures for which binaries were already built and
  deployed as tarballs.
* Hooks up the multi-architecture docker build, deploy, and test to the existing
  Travis CI/CD pipeline. It is organized as a separate stage which only runs if
  all previous steps in the already existing test stage succeed.
This commit is contained in:
Artur Klauser
2019-12-27 07:49:06 +01:00
parent ff5f29f661
commit 499e0ceaba
5 changed files with 141 additions and 26 deletions

View File

@@ -6,13 +6,19 @@ services:
jobs:
include:
- env: BUILD=linux
- stage: Test
env: BUILD=linux
- env: BUILD=windows
- env: BUILD=armv6hf
- env: BUILD=aarch64
- env: BUILD=osx
os: osx
- stage: Deploy docker image
script:
- source ./.multi_arch_docker
- set -ex; multi_arch_docker::main; set +x
before_install: |
DOCKER_BASE="$DOCKER_USERNAME/shellcheck"
DOCKER_BUILDS=""
@@ -28,18 +34,6 @@ script:
- set -ex; build_"$BUILD"; set +x;
- ./.prepare_deploy
after_success: |
if [ "$BUILD" = "linux" ]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
for repo in $DOCKER_BUILDS; do
for tag in $TAGS; do
echo "Deploying $repo:current as $repo:$tag...";
docker tag "$repo:current" "$repo:$tag" || exit 1;
docker push "$repo:$tag" || exit 1;
done;
done;
fi
after_failure: |
id
pwd
@@ -57,4 +51,5 @@ deploy:
local_dir: deploy
on:
repo: koalaman/shellcheck
condition: $TRAVIS_BUILD_STAGE_NAME = Test
all_branches: true