mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-05 20:41:35 -07:00
Make TravisCI auto-build Linux executables.
This commit is contained in:
parent
2ded4df6fa
commit
21f5bf01eb
4 changed files with 24 additions and 66 deletions
|
@ -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"
|
||||
|
|
15
.travis.yml
15
.travis.yml
|
@ -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:
|
||||
|
@ -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
|
||||
|
|
13
Dockerfile
13
Dockerfile
|
@ -1,11 +1,10 @@
|
|||
FROM alpine:latest
|
||||
FROM scratch
|
||||
|
||||
MAINTAINER Nikyle Nguyen <NLKNguyen@MSN.com>
|
||||
MAINTAINER Vidar Holen <vidar@vidarholen.net>
|
||||
|
||||
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"]
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
FROM mitchty/alpine-ghc:latest
|
||||
|
||||
MAINTAINER Nikyle Nguyen <NLKNguyen@MSN.com>
|
||||
|
||||
RUN apk add --no-cache build-base
|
||||
|
||||
RUN mkdir -p /usr/src/shellcheck
|
||||
WORKDIR /usr/src/shellcheck
|
||||
|
||||
# # ------------------------------------------------------------
|
||||
# # Build & Test
|
||||
# # ------------------------------------------------------------
|
||||
|
||||
# Obtain the dependencies first, which are less likely to change, in order to reduce
|
||||
# subsequent build time by leveraging image cache. This benefits developers when they
|
||||
# build their code with this image locally. In case of Travis CI, this doesn't help
|
||||
# reduce building time because Travis CI doesn't use cache.
|
||||
COPY ShellCheck.cabal .
|
||||
RUN cabal update && cabal install --only-dependencies
|
||||
|
||||
# Copy the rest of the source files, including ShellCheck.cabal again but doesn't matter
|
||||
COPY . .
|
||||
|
||||
# Build
|
||||
RUN cabal install
|
||||
|
||||
# Test
|
||||
RUN cabal test
|
||||
|
||||
# # ------------------------------------------------------------
|
||||
# # Set PATH
|
||||
# # ------------------------------------------------------------
|
||||
|
||||
# Add runtime path to easily reach the executable file. This only exists during build.
|
||||
ENV PATH "/root/.cabal/bin:$PATH"
|
||||
|
||||
# Make it permanent for someone who login to the container of this image
|
||||
RUN echo "export PATH=${PATH}" >> /etc/profile
|
||||
|
||||
# # ------------------------------------------------------------
|
||||
# # Extract Binaries
|
||||
# # ------------------------------------------------------------
|
||||
|
||||
# Get shellcheck binary
|
||||
RUN mkdir -p /package/bin/
|
||||
RUN cp $(which shellcheck) /package/bin/
|
||||
|
||||
# Get shared libraries using magic
|
||||
RUN mkdir -p /package/lib/
|
||||
RUN ldd $(which shellcheck) | grep "=> /" | awk '{print $3}' | xargs -I '{}' cp -v '{}' /package/lib/
|
||||
|
||||
|
||||
# Copy shellcheck package out to mounted directory
|
||||
CMD ["cp", "-avr", "/package", "/mnt/"]
|
Loading…
Add table
Add a link
Reference in a new issue