diff --git a/.travis.yml b/.travis.yml index e48cebd..c3b2735 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,12 +24,18 @@ script: - rm -rf dist || true # Linux Docker image - docker build -t "$DOCKER_REPO:$TAG" . + # Linux Alpine based Docker image + - sed 's/^FROM .*/FROM alpine:latest/' Dockerfile > Dockerfile.alpine + - docker build -f Dockerfile.alpine -t "$DOCKER_REPO-alpine:$TAG" . after_success: - ./.prepare_deploy - - docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD" - - |- - ([ "$TRAVIS_BRANCH" == "master" ] || [ -n "$TRAVIS_TAG" ]) && docker push "$DOCKER_REPO:$TAG" + - if [ "$TRAVIS_BRANCH" == "master" ] || [ -n "$TRAVIS_TAG" ]; + then + docker login -e="$DOCKER_EMAIL" -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"; + docker push "$DOCKER_REPO:$TAG"; + docker push "$DOCKER_REPO-alpine:$TAG"; + fi after_failure: - id diff --git a/Dockerfile b/Dockerfile index aea2b21..bdf9b90 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ FROM scratch -MAINTAINER Vidar Holen +LABEL maintainer="Vidar Holen " # This file assumes ShellCheck has already been built. # See https://github.com/koalaman/scbuilder -COPY shellcheck / +COPY shellcheck /bin WORKDIR /mnt -ENTRYPOINT ["/shellcheck"] +ENTRYPOINT ["/bin/shellcheck"] diff --git a/README.md b/README.md index 0e219d0..9bbbd29 100644 --- a/README.md +++ b/README.md @@ -57,20 +57,6 @@ While ShellCheck is mostly intended for interactive use, it can easily be added ShellCheck makes canonical use of exit codes, and can output simple JSON, CheckStyle compatible XML, GCC compatible warnings as well as human readable text (with or without ANSI colors). See the [Integration](https://github.com/koalaman/shellcheck/wiki/Integration) wiki page for more documentation. -## Travis CI Setup - -If you want to use ShellCheck in Travis CI, setting it up is simple :tada:. - -```yml -language: bash -addons: - apt: - sources: - - debian-sid # Grab ShellCheck from the Debian repo - packages: - - shellcheck -``` - ## Installing The easiest way to install ShellCheck locally is through your package manager. @@ -136,13 +122,30 @@ From Docker Hub: docker pull koalaman/shellcheck:latest # Or :v0.4.6 for a release version docker run -v "$PWD:/mnt" koalaman/shellcheck myscript -Alternatively, get freshly built binaries here: +or use `koalaman/shellcheck-alpine` if you want a larger Alpine Linux based image to extend. + +Alternatively, get freshly built binaries for the latest commit here: * [Linux, x86_64](https://storage.googleapis.com/shellcheck/shellcheck-latest.linux.x86_64.tar.xz) (statically linked) * [Windows, x86](https://storage.googleapis.com/shellcheck/shellcheck-latest.zip) or see the [storage bucket listing](https://shellcheck.storage.googleapis.com/index.html) for checksums and release builds. +## Travis CI Setup + +If you want to use ShellCheck in Travis CI, you can most easily install it via `apt`: + +```yml +language: bash +addons: + apt: + sources: + - debian-sid # Grab ShellCheck from the Debian repo + packages: + - shellcheck +``` + + ## Compiling from source This section describes how to build ShellCheck from a source directory. ShellCheck is written in Haskell and requires 2GB of RAM to compile.