-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
29 lines (24 loc) · 949 Bytes
/
.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
image: gitlab.mydomain.com:4567/po/ci-tests:markdown-pdf
stages:
- build
variables:
confluence_page_id: 185991530
attachment_id: att192464363
source_file: Readme.md
dest_file: Gitlab_Readme.pdf
markdown:
stage: build
script:
- >
if git diff HEAD~ --name-only | grep "$source_file"; then
echo -e "Readme.md file was changed, starting building documentation..."
source ~/.bashrc
markdown-pdf $source_file -o $dest_file
curl -k -D- -u "$ad_user_for_external_api_calls:$ad_password_for_external_api_calls" -X POST -H "X-Atlassian-Token: nocheck" -F "file=@Gitlab_Readme.pdf" -F "comment=autogenerated by gitlab ci" -F "minorEdit=false" "https://confluence.mydomain.com/rest/api/content/$confluence_page_id/child/attachment/$attachment_id/data"
else
echo -e "No changes in Readme.md file were detected."
fi
artifacts:
paths:
- "$dest_file"
expire_in: 1 day