-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
50 lines (46 loc) · 1.2 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
stages:
- test
- apply
variables:
HELIX_URL: ${HELIX_URL}
HELIX_API_KEY: ${HELIX_API_KEY}
test_job:
stage: test
image: ubuntu:latest
script:
- apt-get update && apt-get install -y curl sudo
- curl -sL -O https://get.helix.ml/install.sh && bash install.sh --cli -y
- helix test
artifacts:
paths:
- summary_latest.md
when: always
apply_job:
stage: apply
image: ubuntu:latest
script:
- apt-get update && apt-get install -y curl sudo
- curl -sL -O https://get.helix.ml/install.sh && bash install.sh --cli -y
- helix apply -f helix.yaml
only:
- main
- pushes
- web
comment_job:
stage: apply
image: ubuntu:latest
script:
- echo "Commenting on merge request with test results"
- |
if [ -f summary_latest.md ]; then
comment=$(cat summary_latest.md)
curl --request POST \
--header "PRIVATE-TOKEN: ${GITLAB_API_TOKEN}" \
--header "Content-Type: application/json" \
--data "{\"body\": \"${comment}\"}" \
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/merge_requests/${CI_MERGE_REQUEST_IID}/notes"
else
echo "summary_latest.md not found"
fi
only:
- merge_requests