mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-10 10:31:22 +08:00
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:
21
.travis.yml
21
.travis.yml
@@ -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
|
||||
|
Reference in New Issue
Block a user