Skip to content

Commit f9d2f9f

Browse files
committed
feat: add example anonymization script
1 parent 39e7b58 commit f9d2f9f

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ RUN set -Eeuxo pipefail && \
4141
python3-numpy \
4242
python3-pip \
4343
python3-venv \
44+
shellcheck \
4445
sudo && \
4546
apt-get -qy autoremove && \
4647
apt-get clean && \

Jenkinsfile

+8-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ pipeline {
2525
stage('Lint') {
2626
environment {
2727
PYTHON_MODULES = "${env.PYTHON_PACKAGE} test *.py"
28+
SHELL_SCRIPTS = '*.sh'
2829
}
2930
steps {
3031
sh """#!/usr/bin/env bash
@@ -37,6 +38,8 @@ pipeline {
3738
echo "\${PIPESTATUS[0]}" | tee flake518_status.log
3839
python3 -m pydocstyle ${PYTHON_MODULES} |& tee pydocstyle.log
3940
echo "\${PIPESTATUS[0]}" | tee pydocstyle_status.log
41+
shellcheck ${SHELL_SCRIPTS} |& tee shellcheck.log
42+
echo "\${PIPESTATUS[0]}" | tee shellcheck_status.log
4043
"""
4144
}
4245
}
@@ -61,7 +64,11 @@ pipeline {
6164
echo "${PIPESTATUS[0]}" | tee coverage_status.log
6265
'''
6366
script {
64-
defaultHandlers.afterPythonBuild()
67+
if (env.CHANGE_ID) {
68+
HashMap toolResults = pythonUtils.prepareLintingReport()
69+
toolResults['shellcheck'] = languageUtils.prepareToolReport('shellcheck')
70+
repoUtils.postToolsReportOnPR(toolResults)
71+
}
6572
}
6673
}
6774
}

cleanup_examples.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
set -Eeuxo pipefail
3+
4+
HOSTNAME=$(hostname)
5+
USER=$(whoami)
6+
7+
FILES=('README.rst' 'examples.ipynb')
8+
9+
for file in "${FILES[@]}" ; do
10+
sed -i "s|${USER}|user|" "${file}"
11+
sed -i "s|${HOSTNAME}|hostname|" "${file}"
12+
done

0 commit comments

Comments
 (0)