[CI] Run shellcheck as part of Jenkins pipelines

The pipeline is failed only when pylint whines about the code actually
touched as part of the pull request.

The `run-shellcheck` script is provided so it can be reused, maybe in
`.git/hooks/pre-push`.
This commit is contained in:
Wojtek Porczyk
2019-12-11 17:16:09 +01:00
parent 4114337da0
commit efbf2706dd
9 changed files with 56 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
#!/bin/sh
cd "$(git rev-parse --show-toplevel)"
shellcheck "$@" \
LibOS/shim/test/apps/bash/scripts/bash_test.sh \
LibOS/shim/test/apps/common_tools/benchmark-http.sh \
LibOS/shim/test/apps/python-simple/run-tests.sh \
LibOS/shim/test/native/*.sh \
Pal/ipc/linux/*.sh \
Pal/src/host/FreeBSD/pal-gdb.template \
Pal/src/host/Linux-SGX/debugger/gdb \
Pal/src/host/Linux-SGX/sgx-driver/load.sh \
Runtime/pal_loader \
Scripts/clean-check \
Scripts/clean-check-prepare \
Scripts/clean-check-test-copy \
Scripts/list-all-graphene.sh \
Scripts/memusg \
.ci/run-pylint \
.ci/run-shellcheck
+8
View File
@@ -3,6 +3,14 @@ pipeline {
dockerfile { filename 'Jenkinsfiles/ubuntu-16.04.dockerfile' }
}
stages {
stage('Lint') {
steps {
sh '''
./.ci/run-shellcheck || :
./.ci/run-shellcheck -f json | ./.ci/prfilter
'''
}
}
stage('Build') {
steps {
sh '''
+3
View File
@@ -8,6 +8,9 @@ pipeline {
sh '''
./.ci/run-pylint -f text || :
./.ci/run-pylint -f json | ./.ci/prfilter
./.ci/run-shellcheck || :
./.ci/run-shellcheck -f json | ./.ci/prfilter
'''
}
}
+8
View File
@@ -3,6 +3,14 @@ pipeline {
dockerfile { filename 'Jenkinsfiles/ubuntu-16.04.dockerfile' }
}
stages {
stage('Lint') {
steps {
sh '''
./.ci/run-shellcheck || :
./.ci/run-shellcheck -f json | ./.ci/prfilter
'''
}
}
stage('Build') {
steps {
sh '''
+3
View File
@@ -8,6 +8,9 @@ pipeline {
sh '''
./.ci/run-pylint -f text || :
./.ci/run-pylint -f json | ./.ci/prfilter
./.ci/run-shellcheck || :
./.ci/run-shellcheck -f json | ./.ci/prfilter
'''
}
}
+8
View File
@@ -6,6 +6,14 @@ pipeline {
}
}
stages {
stage('Lint') {
steps {
sh '''
./.ci/run-shellcheck || :
./.ci/run-shellcheck -f json | ./.ci/prfilter
'''
}
}
stage('Build') {
steps {
sh '''
+3
View File
@@ -11,6 +11,9 @@ pipeline {
sh '''
./.ci/run-pylint -f text || :
./.ci/run-pylint -f json | ./.ci/prfilter
./.ci/run-shellcheck || :
./.ci/run-shellcheck -f json | ./.ci/prfilter
'''
}
}
+1
View File
@@ -35,6 +35,7 @@ RUN apt-get update \
python3-pip \
python3-pytest \
python3-scipy \
shellcheck \
texinfo \
wget \
zlib1g \
+1
View File
@@ -37,6 +37,7 @@ RUN apt-get update && env DEBIAN_FRONTEND=noninteractive apt-get install -y \
python3-protobuf \
python3-pytest \
python3-scipy \
shellcheck \
texinfo \
wget \
zlib1g \