CI: Move CI code into a single script

This commit is contained in:
Saverio Miroddi 2021-04-24 09:28:40 +02:00
parent df5ce73e76
commit 93289c7c09
2 changed files with 16 additions and 7 deletions

View File

@ -5,10 +5,4 @@ cache:
directories: directories:
- "/opt/shellcheck" - "/opt/shellcheck"
script: script:
- mkdir -p /opt/shellcheck - ci/run_shellcheck
- "[[ ! -e /opt/shellcheck/shellcheck ]] && wget -qO- https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz
| tar -xJv -O shellcheck-stable/shellcheck | sudo tee /opt/shellcheck/shellcheck
> /dev/null || true"
- sudo chmod +x /opt/shellcheck/shellcheck
- "/opt/shellcheck/shellcheck --version"
- "/opt/shellcheck/shellcheck $(grep -lzP '^#!/bin/\\w+sh' -r .)"

15
ci/run_shellcheck.sh Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
set -o pipefail
set -o errexit
set -o nounset
set -o errtrace
shopt -s inherit_errexit
ci/run_shellcheck mkdir -p /opt/shellcheck
[[ ! -e /opt/shellcheck/shellcheck ]] && wget -qO- https://github.com/koalaman/shellcheck/releases/download/stable/shellcheck-stable.linux.x86_64.tar.xz
| tar -xJv -O shellcheck-stable/shellcheck | sudo tee /opt/shellcheck/shellcheck
> /dev/null || true
sudo chmod +x /opt/shellcheck/shellcheck
/opt/shellcheck/shellcheck --version
/opt/shellcheck/shellcheck $(grep -lzP '^#!/bin/\\w+sh' -r .)