-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.gitlab-ci.yml.example
More file actions
41 lines (37 loc) · 1.03 KB
/
.gitlab-ci.yml.example
File metadata and controls
41 lines (37 loc) · 1.03 KB
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
stages:
- requirements
- execute
variables:
GIT_SUBMODULE_STRATEGY: normal
workflow:
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
python:
tags:
- python
- prd
stage: requirements
script:
- pip3 install -r requirements.txt
vars:
tags:
- python
- prd
stage: execute
script:
- |
# Check files changed for current commit, usually master or main
# -m - include parents of merge
CHANGED_FILES=$(git diff-tree -m --no-commit-id --name-only -r $CI_COMMIT_SHA)
for F in ${CHANGED_FILES}; do
if [[ "${F}" == *.yaml && -f "${F}" ]]; then
echo Processing file: ${F}
./projects.py --apply-variables --yaml ${F}
elif [[ "${F}" == *.inc && -f "${F}" ]]; then
FILES_INCLUDE_CHANGED_FILE=$(grep -l -r ${F} projects)
for I in ${FILES_INCLUDE_CHANGED_FILE}; do
echo Processing file: ${I}
./projects.py --apply-variables --yaml ${I}
done
fi
done