forked from litmuschaos/litmus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
53 lines (47 loc) · 1.35 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
---
stages:
- litmusImageBuild
- litmusPythonTest
- litmusAnsibleTest
- baseline
- litmusImagePush
Build Litmus Image:
stage: litmusImageBuild
script:
- sudo docker build . -f build/ansible-runner/Dockerfile -t litmuschaos/ansible-runner:ci
Test Litmus PyTest Suite:
stage: litmusPythonTest
script:
- ./hack/pytest-suite
Test Litmus Playbook Syntax:
stage: litmusAnsibleTest
script:
- sudo docker run litmuschaos/ansible-runner:ci ./syntax-check
baseline-image:
when: always
stage: baseline
tags:
- test
only:
refs:
- /^(v[0-9][.][0-9][.]x|master)?$/
script:
- pwd
- export BRANCH=${CI_COMMIT_REF_NAME}
- echo $BRANCH
- export COMMIT=${CI_COMMIT_SHORT_SHA}
- echo $COMMIT
- git clone https://github.com/litmuschaos/litmus-e2e.git
- cd litmus-e2e
- git checkout ${BASELINE_BRANCH}
- cd baseline
- ansible-playbook commit-writer.yml --extra-vars "branch=$BRANCH repo=$CI_PROJECT_NAME commit=$COMMIT"
- git status
- git add baseline
- git status
- git commit -m "updated $CI_PROJECT_NAME commit:$COMMIT"
- git push http://${YOUR_USERNAME}:${PERSONAL_ACCESS_TOKEN}@github.com/litmuschaos/litmus-e2e.git --all
Push Litmus Image:
stage: litmusImagePush
script:
- REPONAME="litmuschaos" IMGNAME="ansible-runner" IMGTAG="ci" ./hack/push