mirror of
https://github.com/koalaman/shellcheck
synced 2025-07-16 10:03:08 -07:00
* 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.
26 lines
779 B
Text
26 lines
779 B
Text
# Alpine image
|
|
FROM alpine:latest AS alpine
|
|
LABEL maintainer="Vidar Holen <vidar@vidarholen.net>"
|
|
ARG tag
|
|
|
|
# Put the right binary for each architecture into place for the
|
|
# multi-architecture docker image.
|
|
RUN set -x; \
|
|
arch="$(uname -m)"; \
|
|
echo "arch is $arch"; \
|
|
if [ "${arch}" = 'armv7l' ]; then \
|
|
arch='armv6hf'; \
|
|
fi; \
|
|
url_base='https://shellcheck.storage.googleapis.com/'; \
|
|
tar_file="shellcheck-${tag}.linux.${arch}.tar.xz"; \
|
|
wget "${url_base}${tar_file}" -O - | tar xJf -; \
|
|
mv "shellcheck-${tag}/shellcheck" /bin/; \
|
|
rm -rf "shellcheck-${tag}"; \
|
|
ls -laF /bin/shellcheck
|
|
|
|
# ShellCheck image
|
|
FROM scratch
|
|
LABEL maintainer="Vidar Holen <vidar@vidarholen.net>"
|
|
WORKDIR /mnt
|
|
COPY --from=alpine /bin/shellcheck /bin/
|
|
ENTRYPOINT ["/bin/shellcheck"]
|