Skip to content

Commit

Permalink
Make TravisCI auto-build Linux executables.
Browse files Browse the repository at this point in the history
  • Loading branch information
koalaman committed Jun 25, 2017
1 parent 2ded4df commit 21f5bf0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 66 deletions.
8 changes: 8 additions & 0 deletions .prepare_deploy
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ do
zip "${file%.*}.zip" README.txt LICENSE.txt "$file"
done

for file in *.linux
do
base="${file%.*}"
cp "$file" "shellcheck"
tar -cJf "$base.linux.x86_64.tar.xz" --transform="s:^:$base/:" README.txt LICENSE.txt shellcheck
rm "shellcheck"
done

for file in ./*
do
sha512sum "$file" > "$file.sha512sum"
Expand Down
15 changes: 10 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ script:
- mkdir deploy
# Windows .exe
- docker pull koalaman/winghc
- docker run -v "$PWD:/appdata" koalaman/winghc cuib
- docker run --user="$UID" --rm -v "$PWD:/appdata" koalaman/winghc cuib
- cp "dist/build/ShellCheck/shellcheck.exe" "deploy/shellcheck-$TAG.exe"
# Linux Docker
- docker build -t builder -f Dockerfile_builder .
- docker run --rm -it -v "$(pwd):/mnt" builder
- rm -rf dist || true
# Linux static executable
- docker pull koalaman/scbuilder
- docker run --user="$UID" --rm -v "$PWD:/mnt" koalaman/scbuilder
- cp "shellcheck" "deploy/shellcheck-$TAG.linux"
- rm -rf dist || true
# Linux Docker image
- docker build -t "$DOCKER_REPO:$TAG" .

after_success:
Expand All @@ -28,10 +32,11 @@ after_success:
([ "$TRAVIS_BRANCH" == "master" ] || [ -n "$TRAVIS_TAG" ]) && docker push "$DOCKER_REPO:$TAG"
after_failure:
- id
- pwd
- df -h
- find . -name '*.log' -type f -exec grep "" /dev/null {} +
- find .
- find . -ls

deploy:
provider: gcs
Expand Down
13 changes: 6 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
FROM alpine:latest
FROM scratch

MAINTAINER Nikyle Nguyen <[email protected]>
MAINTAINER Vidar Holen <[email protected]>

COPY package/bin/shellcheck /usr/local/bin/
COPY package/lib/ /usr/local/lib/

RUN ldconfig /usr/local/lib
# This file assumes ShellCheck has already been built.
# See https://github.com/koalaman/scbuilder
COPY shellcheck /

WORKDIR /mnt
ENTRYPOINT ["shellcheck"]
ENTRYPOINT ["/shellcheck"]
54 changes: 0 additions & 54 deletions Dockerfile_builder

This file was deleted.

0 comments on commit 21f5bf0

Please sign in to comment.