-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
65 lines (57 loc) · 2.13 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
# Pipeline for ACI changes that contains PCVs and sends info message to WebEx room.
variables:
bearer: ""
roomId: ""
stages:
- init-webex
- query
- build
- test
- notify
init-webex:
stage: init-webex
script:
- >-
curl -H "Content-Type: application/json" -H 'Authorization: Bearer '"$bearer"'' -i -v -X POST -d ' {"roomId": "'"$roomId"'", "markdown":"
###################\n Hello Rob, we are kicking off pipeline: '"${CI_PROJECT_NAME}"' - change: #'"${CI_PIPELINE_ID}"'
"}' https://api.ciscospark.com/v1/messages
query:
stage: query
before_script:
- >-
curl -H "Content-Type: application/json" -H 'Authorization: Bearer '"$bearer"'' -i -v -X POST -d ' {"roomId": "'"$roomId"'", "markdown":"
Starting stage: '"${CI_JOB_STAGE}"' with job ID: '"${CI_JOB_ID}"'
"}' https://api.ciscospark.com/v1/messages
script:
- ansible-playbook nae.yaml -i hosts -vvv
build-aci:
stage: build
before_script:
- >-
curl -H "Content-Type: application/json" -H 'Authorization: Bearer '"$bearer"'' -i -v -X POST -d ' {"roomId": "'"$roomId"'", "markdown":"
Starting stage: '"${CI_JOB_STAGE}"' with job ID: '"${CI_JOB_ID}"'
"}' https://api.ciscospark.com/v1/messages
script:
- ansible-playbook aci.yaml -i hosts
test:
stage: test
script:
- echo "docker test ci run on local mac"
notify_failure:
stage: notify
when: on_failure
script:
- >-
curl -H "Content-Type: application/json" -H 'Authorization: Bearer '"$bearer"'' -i -v -X POST -d ' {"roomId": "'"$roomId"'", "markdown":"
We have aborted pipeline '"${CI_PIPELINE_URL}"' on branch '"${CI_COMMIT_REF_SLUG}"' \n\n The following issues have been found: \n\n
"}' https://api.ciscospark.com/v1/messages
- >-
python3 parser.py
notify_success:
stage: notify
when: on_success
script:
- >-
curl -H "Content-Type: application/json" -H 'Authorization: Bearer '"$bearer"'' -i -v -X POST -d ' {"roomId": "'"$roomId"'", "markdown":"
Success on pipeline '"${CI_PIPELINE_URL}"' on branch '"${CI_COMMIT_REF_SLUG}"'\n ################### \n\n
"}' https://api.ciscospark.com/v1/messages