Skip to content

Commit d72ce34

Browse files
martin-gadrianreber
authored andcommitted
docs & test-suite: shellcheck lint the get_source.sh scripts
Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org> (cherry picked from commit 095a8f3)
1 parent ba3b193 commit d72ce34

3 files changed

Lines changed: 15 additions & 11 deletions

File tree

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,33 @@
11
#!/usr/bin/env bash
22

3+
set -xe
4+
35
# Note: The current working directory is the component's SPEC folder
46

57
# The folder that will contain the .git/ and docs/ folders
6-
DOCS_OHPC_FOLDER=docs-ohpc
8+
DOCS_OHPC_FOLDER="docs-ohpc"
79
# A folder that contains the full Git history of the project
810
# Full history is needed for the usage of `git archive` command
911
COMPLETE_OHPC_FOLDER=$(mktemp -d)
1012

1113
cleanup() {
12-
rm -rf ${DOCS_OHPC_FOLDER} ${COMPLETE_OHPC_FOLDER}
14+
rm -rf "${DOCS_OHPC_FOLDER}" "${COMPLETE_OHPC_FOLDER}"
1315
}
1416
trap cleanup EXIT
1517

1618
# 1. Prepare
1719
cleanup
18-
mkdir -p ${DOCS_OHPC_FOLDER}
20+
mkdir -p "${DOCS_OHPC_FOLDER}"
1921

2022
# 2. Fetch the full Git history so that `git describe` works later
21-
git clone https://github.com/openhpc/ohpc ${COMPLETE_OHPC_FOLDER}
22-
cp -r ${COMPLETE_OHPC_FOLDER}/.git ${DOCS_OHPC_FOLDER}
23+
git clone https://github.com/openhpc/ohpc "${COMPLETE_OHPC_FOLDER}"
24+
cp -r "${COMPLETE_OHPC_FOLDER}/.git" "${DOCS_OHPC_FOLDER}"
2325

2426
# 3. Copy the local docs/
25-
cp -r ../../../../docs ${DOCS_OHPC_FOLDER}
27+
cp -r ../../../../docs "${DOCS_OHPC_FOLDER}"
2628

2729
# 4. Create docs-ohpc.tar
28-
tar cf ../SOURCES/docs-ohpc.tar ${DOCS_OHPC_FOLDER}
30+
tar cf ../SOURCES/docs-ohpc.tar "${DOCS_OHPC_FOLDER}"
2931

3032
# 5. Cleanup
3133
cleanup

components/admin/test-suite/SOURCES/get_source.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ OHPC_ROOT_FOLDER="../../../.."
99
TESTS_OHPC_FOLDER=tests-ohpc
1010

1111
cleanup() {
12-
rm -rf ${TESTS_OHPC_FOLDER}
12+
rm -rf "${TESTS_OHPC_FOLDER}"
1313
}
1414
trap cleanup EXIT
1515

1616
# 1. Prepare
1717
cleanup
18-
mkdir -p ${TESTS_OHPC_FOLDER}
18+
mkdir -p "${TESTS_OHPC_FOLDER}"
1919

2020
# 2. Copy the local docs/
21-
cp -r ${OHPC_ROOT_FOLDER}/tests ${TESTS_OHPC_FOLDER}
21+
cp -r "${OHPC_ROOT_FOLDER}/tests" "${TESTS_OHPC_FOLDER}"
2222

2323
# 3. Create tests-ohpc.tar
24-
tar cf ../SOURCES/tests-ohpc.tar ${TESTS_OHPC_FOLDER}
24+
tar cf ../SOURCES/tests-ohpc.tar "${TESTS_OHPC_FOLDER}"

tests/ci/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ shellcheck-lint:
4545
../../misc/shell-functions \
4646
../../tests/ci/prepare-ci-environment.sh \
4747
../../tests/ci/setup_slurm_and_run_tests.sh \
48+
../../components/admin/docs/SOURCES/get_source.sh \
49+
../../components/admin/test-suite/SOURCES/get_source.sh \
4850
../../tests/libs/netcdf/ohpc-tests/netcdf_all_test_mpi_families \
4951
../../tests/libs/netcdf/ohpc-tests/test_mpi_families \
5052
../../components/OHPC_setup_mpi \

0 commit comments

Comments
 (0)