81 lines
3.0 KiB
YAML
81 lines
3.0 KiB
YAML
sudo: required
|
|
|
|
language: sh
|
|
|
|
services:
|
|
- docker
|
|
|
|
before_install:
|
|
- DOCKER_BASE="$DOCKER_USERNAME/shellcheck"
|
|
- DOCKER_BUILDS=""
|
|
- TAGS=""
|
|
- test "$TRAVIS_BRANCH" = master && TAGS="$TAGS latest" || true
|
|
- test -n "$TRAVIS_TAG" && TAGS="$TAGS stable $TRAVIS_TAG" || true
|
|
- echo "Tags are $TAGS"
|
|
|
|
script:
|
|
- mkdir deploy
|
|
# Remove all tests to reduce binary size
|
|
- ./striptests
|
|
# Linux Docker image
|
|
- name="$DOCKER_BASE"
|
|
- DOCKER_BUILDS="$DOCKER_BUILDS $name"
|
|
- docker build -t "$name:current" .
|
|
- docker run "$name:current" --version
|
|
- printf '%s\n' "#!/bin/sh" "echo 'hello world'" > myscript
|
|
- docker run -v "$PWD:/mnt" "$name:current" myscript
|
|
# Copy static executable from docker image
|
|
- id=$(docker create "$name:current")
|
|
- docker cp "$id:/bin/shellcheck" "shellcheck"
|
|
- docker rm "$id"
|
|
- ls -l shellcheck
|
|
- ./shellcheck myscript
|
|
- for tag in $TAGS; do cp "shellcheck" "deploy/shellcheck-$tag.linux-x86_64"; done
|
|
# Linux Alpine based Docker image
|
|
- name="$DOCKER_BASE-alpine"
|
|
- DOCKER_BUILDS="$DOCKER_BUILDS $name"
|
|
- sed -e '/DELETE-MARKER/,$d' Dockerfile > Dockerfile.alpine
|
|
- docker build -f Dockerfile.alpine -t "$name:current" .
|
|
- docker run "$name:current" sh -c 'shellcheck --version'
|
|
# Linux armv6hf static executable
|
|
- docker run -v "$PWD:/mnt" koalaman/armv6hf-builder -c 'compile-shellcheck'
|
|
- for tag in $TAGS; do cp "shellcheck" "deploy/shellcheck-$tag.linux-armv6hf"; done
|
|
- rm -f shellcheck || true
|
|
# Windows .exe
|
|
- docker run --user="$UID" -v "$PWD:/appdata" koalaman/winghc cuib
|
|
- for tag in $TAGS; do cp "dist/build/ShellCheck/shellcheck.exe" "deploy/shellcheck-$tag.exe"; done
|
|
- rm -rf dist shellcheck || true
|
|
# Misc packaging
|
|
- ./.prepare_deploy
|
|
|
|
after_success:
|
|
- 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;
|
|
|
|
after_failure:
|
|
- id
|
|
- pwd
|
|
- df -h
|
|
- find . -name '*.log' -type f -exec grep "" /dev/null {} +
|
|
- find . -ls
|
|
|
|
deploy:
|
|
provider: gcs
|
|
skip_cleanup: true
|
|
access_key_id: GOOG7MDN7WEH6IIGBDCA
|
|
secret_access_key:
|
|
secure: Bcx2cT0/E2ikj7sdamVq52xlLZF9dz9ojGPtoKfPyQhkkZa+McVI4xgUSuyyoSxyKj77sofx2y8m6PJYYumT4g5hREV1tfeUkl0J2DQFMbGDYEt7kxVkXCxojNvhHwTzLFv0ezstrxWWxQm81BfQQ4U9lggRXtndAP4czZnOeHPINPSiue1QNwRAEw05r5UoIUJXy/5xyUrjIxn381pAs+gJqP2COeN9kTKYH53nS/AAws29RprfZFnPlo7xxWmcjRcdS5KPdGXI/c6tQp5zl2iTh510VC1PN2w1Wvnn/oNWhiNdqPyVDsojIX5+sS3nejzJA+KFMxXSBlyXIY3wPpS/MdscU79X6Q5f9ivsFfsm7gNBmxHUPNn0HAvU4ROT/CCE9j6jSbs5PC7QBo3CK4++jxAwE/pd9HUc2rs3k0ofx3rgveJ7txpy5yPKfwIIBi98kVKlC4w7dLvNTOfjW1Imt2yH87XTfsE0UIG9st1WII6s4l/WgBx2GuwKdt6+3QUYiAlCFckkxWi+fAvpHZUEL43Qxub5fN+ZV7Zib1n7opchH4QKGBb6/y0WaDCmtCfu0lppoe/TH6saOTjDFj67NJSElK6ZDxGZ3uw4R+ret2gm6WRKT2Oeub8J33VzSa7VkmFpMPrAAfPa9N1Z4ewBLoTmvxSg2A0dDrCdJio=
|
|
bucket: shellcheck
|
|
local-dir: deploy
|
|
on:
|
|
repo: koalaman/shellcheck
|
|
all_branches: true
|