-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
31 lines (30 loc) · 1.25 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
---
stages:
# - build
- tests
'TODO registrar':
stage: tests
image:
name: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA
interruptible: false
allow_failure: true
script:
- |
export MR_TARGET_BRANCH=development
export TR_NEW_BRANCH=todo-registrar-$(echo "$RANDOM$RANDOM$RANDOM" | base64 | head -c 8; echo)
export TR_MR_EXISTS=$(bash scripts/gitlab/mr_check_existing.sh $MR_TARGET_BRANCH "todo-registrar-[[:alnum:]]{8}")
if [[ "0" == "$TR_MR_EXISTS" ]]; then
echo "NO opened MR exists! Looking for new TODOs..."
vendor/bin/todo-registrar --config=scripts/todo-registrar/config.php
export TR_TITLE="TODO-REGISTRAR: automated registering of new TODOs "
export TR_PUSHED=$(bash scripts/gitlab/commit_and_push.sh $TR_NEW_BRANCH "$TR_TITLE")
if [[ "1" == "$TR_PUSHED" ]]; then
bash scripts/gitlab/mr_create.sh $MR_TARGET_BRANCH $TR_NEW_BRANCH "$TR_TITLE"
else
echo "No changes, nothing to commit & push!"
fi
else
echo "Registering of TODOs is skip case opened MR exists!"
fi
only:
- development