Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Upgrade Shellcheck (fixes #34) #37

Merged
merged 6 commits into from
Oct 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Update Shellcheck
run: ./src/download_shellcheck.sh
- name: Install Shellcheck
run: ./src/install_shellcheck.sh
- name: Run tests
run: ./tests/test_runner
shell: bash
Expand Down
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
FROM alpine:3.10.3
FROM alpine:3.13.6

RUN echo "http://dl-cdn.alpinelinux.org/alpine/v3.11/community" >> /etc/apk/repositories; \
apk update && apk add --no-cache bash shellcheck=0.7.0-r1
RUN apk update && apk add --no-cache bash
RUN bash --version

RUN bash --version && shellcheck --version
COPY ./src/install_shellcheck.sh ./install_shellcheck.sh
RUN ./install_shellcheck.sh

COPY entrypoint.sh /entrypoint.sh

Expand Down
8 changes: 4 additions & 4 deletions src/download_shellcheck.sh → src/install_shellcheck.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#! /bin/bash
#!/bin/bash

# Update shellcheck to the locked v0.7.0 version through the binary distribution
scversion='v0.7.0'
scversion='v0.7.2'

wget -qO- "https://github.com/koalaman/shellcheck/releases/download/${scversion?}/shellcheck-${scversion?}.linux.x86_64.tar.xz" | tar -xJv
sudo cp "shellcheck-${scversion}/shellcheck" /usr/bin/
cp "shellcheck-${scversion}/shellcheck" /usr/local/bin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 💯

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting side-note ~ check out the shellcheck-alpine image. They also seem to remove the shellcheck-${tag} folder

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of a cleaning up the unnecessary files/folders post installation! Made the change in our script as well!

rm -rf "shellcheck-${scversion}"
shellcheck --version