-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path.gitlab-ci.yml
68 lines (60 loc) · 1.87 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
variables:
# B101 assert_used
# B104 hardcoded_bind_all_interfaces
# B108 hardcoded_tmp_directory
# B605 start_process_with_a_shell
# B602 subprocess_popen_with_shell_equals_true
# B608 hardcoded_sql_expressions
# B105 hardcoded_password_string
BANDIT_SKIPS: 'B101,B104,B108,B605,B602,B608,B105'
CI_REGISTRY_IMAGE: registry.gitlab.isc.org/isc-projects/forge
image: "${CI_REGISTRY_IMAGE}:latest"
.get_modified_python_scripts: &get_modified_python_scripts
- |
MODIFIED_PYTHON_SCRIPTS=
for i in $(git diff --name-only $(git merge-base origin/master HEAD)); do
if echo ${i} | grep -E '.py$' > /dev/null 2>&1; then
if ! echo ${PYTHON_EXCLUDE} | grep -F "${i}" > /dev/null 2>&1; then
MODIFIED_PYTHON_SCRIPTS+=" ${i}"
fi
fi
done
if test -z "${MODIFIED_PYTHON_SCRIPTS}"; then
echo "No python scripts to check. Exiting early."
exit 0
else
echo "Checking python scripts: ${MODIFIED_PYTHON_SCRIPTS}"
fi
bandit:
script:
- *get_modified_python_scripts
- bandit --skip="${BANDIT_SKIPS}" ${MODIFIED_PYTHON_SCRIPTS}
pages:
script:
# Add __init__.py files.
- touch __init__.py
- >
find ./* -type d
-not -path './dhcp/burnin/scripts/tci*'
-not -path './unused/performance/charts*'
-exec touch {}/__init__.py ';'
# Generate docs.
- pydoctor --docformat restructuredtext --html-output public .
artifacts:
paths:
- public
rules:
# Deploy docs only on merge to master.
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: on_success
pydocstyle:
script:
- *get_modified_python_scripts
- pydocstyle ${MODIFIED_PYTHON_SCRIPTS}
pydoctor:
script:
- *get_modified_python_scripts
- pydoctor --docformat restructuredtext ${MODIFIED_PYTHON_SCRIPTS}
pylint-and-pycodestyle:
script:
- ./check-style.sh --changed