-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
83 lines (73 loc) · 2.12 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# stages:
# - save-rollback
# - validate
# - update-test
# - check-test
# - update-prod
# - check-prod
# - load-rollback
# image: ghcr.io/model-driven-devops/mdd:1.2.6rc3
# variables:
# ANSIBLE_CONFIG: "./ansible.cfg"
# CML_VERIFY_CERT: "false"
# save-rollback:
# stage: save-rollback
# script:
# - ansible-playbook -i inventory_test ciscops.mdd.nso_save_rollback
# resource_group: mdd
# artifacts:
# paths:
# - rollback.yaml
# expire_in: 1 hour
# rules:
# - if: $CI_PIPELINE_SOURCE == "merge_request_event"
# validate:
# stage: validate
# script:
# - yamllint mdd-data
# - ansible-playbook -i inventory_prod ciscops.mdd.validate
# resource_group: mdd
# rules:
# - if: $CI_PIPELINE_SOURCE == "merge_request_event"
# update-test:
# stage: update-test
# script:
# - ansible-playbook -i inventory_test ciscops.mdd.update -e dry_run=no
# resource_group: mdd
# rules:
# - if: $CI_PIPELINE_SOURCE == "merge_request_event"
# - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "main"
# check-test:
# stage: check-test
# script:
# # allow network to converge before running checks
# - sleep 60
# - ansible-playbook -i inventory_test ciscops.mdd.check
# resource_group: mdd
# rules:
# - if: $CI_PIPELINE_SOURCE == "merge_request_event"
# update-prod:
# stage: update-prod
# script:
# # update devices in case DHCP address changed
# - ansible-playbook -i inventory_prod ciscops.mdd.update -e dry_run=no
# resource_group: mdd
# rules:
# - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "main"
# check-prod:
# stage: check-prod
# script:
# # allow network to converge before running checks
# - sleep 60
# - ansible-playbook -i inventory_prod ciscops.mdd.check
# resource_group: mdd
# rules:
# - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "main"
# load-rollback:
# stage: load-rollback
# script:
# - ansible-playbook -i inventory_test ciscops.mdd.nso_load_rollback
# resource_group: mdd
# rules:
# - if: $CI_PIPELINE_SOURCE == "merge_request_event"
# when: always