Test XtestingCI in ansible remote mode
[releng.git] / jjb / functest / xtesting-ci.yaml
1 ---
2 - builder:
3     name: xtesting-ci-tests
4     builders:
5       - shell: |
6           set +x
7           sudo apt-get -o DPkg::Lock::Timeout=300 update
8           sudo DEBIAN_FRONTEND=noninteractive apt-get \
9             -o DPkg::Lock::Timeout=300 install python3-pip docker.io -y
10           curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.17.0/kind-linux-amd64
11           chmod +x ./kind
12           sudo mv ./kind /usr/local/bin/kind
13           kind delete clusters xtesting jenkins gitlab || true
14           sudo docker ps -aq |xargs sudo docker stop || true
15           sudo docker ps -aq |xargs sudo docker rm || true
16           sudo docker system prune -f --all || true
17           sudo rm -f /etc/systemd/system/docker.service.d/http-proxy.conf
18           sudo systemctl daemon-reload
19           sudo systemctl restart docker
20           sudo rm -rfv /data /tmp/xtesting*
21           sudo apt-get install ansible patch -y
22           rm -rf ~/.ansible/roles/collivier.xtesting
23           case {release} in
24           stable)
25             ansible-galaxy install -f collivier.xtesting ;;
26           *)
27             ansible-galaxy install -f git+https://github.com/collivier/ansible-role-xtesting.git,{release}
28             mv ~/.ansible/roles/ansible-role-xtesting ~/.ansible/roles/collivier.xtesting ;;
29           esac
30           (cd ~/.ansible/roles/collivier.xtesting; patch -p1 < tests/docker_config_json.patch)
31           ansible-galaxy collection install -f -r ~/.ansible/roles/collivier.xtesting/requirements.yml
32           ansible-playbook -vvvv ~/.ansible/roles/collivier.xtesting/tests/{playbook}.yml
33
34 - builder:
35     name: xtesting-ci-tests-remote
36     builders:
37       - shell: |
38           set +x
39           ssh opnfv@10.200.140.224 << EOF
40             sudo apt-get -o DPkg::Lock::Timeout=300 update
41             sudo DEBIAN_FRONTEND=noninteractive apt-get \
42               -o DPkg::Lock::Timeout=300 install python3-pip docker.io -y
43             curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.17.0/kind-linux-amd64
44             chmod +x ./kind
45             sudo mv ./kind /usr/local/bin/kind
46             kind delete clusters xtesting jenkins gitlab || true
47             sudo docker ps -aq |xargs sudo docker stop || true
48             sudo docker ps -aq |xargs sudo docker rm || true
49             sudo docker system prune -f --all || true
50             sudo rm -f /etc/systemd/system/docker.service.d/http-proxy.conf
51             sudo systemctl daemon-reload
52             sudo systemctl restart docker
53             sudo rm -rfv /data /tmp/xtesting*
54           EOF
55           sudo apt-get install ansible patch -y
56           rm -rf ~/.ansible/roles/collivier.xtesting
57           case {release} in
58           stable)
59             ansible-galaxy install -f collivier.xtesting ;;
60           *)
61             ansible-galaxy install -f git+https://github.com/collivier/ansible-role-xtesting.git,{release}
62             mv ~/.ansible/roles/ansible-role-xtesting ~/.ansible/roles/collivier.xtesting ;;
63           esac
64           (cd ~/.ansible/roles/collivier.xtesting; patch -p1 < tests/docker_config_json.patch)
65           ansible-galaxy collection install -f -r ~/.ansible/roles/collivier.xtesting/requirements.yml
66           sed -i "s/127.0.0.1/10.200.140.224/g" ~/.ansible/roles/collivier.xtesting/tests/{playbook}.yml
67           echo 10.200.140.224 ansible_host=10.200.140.224 ansible_user=opnfv > /tmp/inventory
68           ansible-playbook -i /tmp/inventory -vvvv ~/.ansible/roles/collivier.xtesting/tests/{playbook}.yml
69
70 - parameter:
71     name: xtesting-ci-node
72     parameters:
73       - label:
74           name: node
75           default: '{node}'
76
77 - job-template:
78     name: 'xtesting-ci-tests-{release}-{playbook}'
79     triggers:
80       - timed: '@daily'
81     parameters:
82       - xtesting-ci-node:
83           node: '{node}'
84     properties:
85       - build-blocker:
86           use-build-blocker: true
87           blocking-level: 'NODE'
88           blocking-jobs:
89             - '^xtesting-ci-tests-.*$'
90     builders:
91       - xtesting-ci-tests:
92           playbook: '{playbook}'
93           release: '{release}'
94
95 - job-template:
96     name: 'xtesting-ci-tests-remote-{release}-{playbook}'
97     triggers:
98       - timed: '@daily'
99     parameters:
100       - xtesting-ci-node:
101           node: '{node}'
102     properties:
103       - build-blocker:
104           use-build-blocker: true
105           blocking-level: 'NODE'
106           blocking-jobs:
107             - '^xtesting-ci-tests-.*$'
108     builders:
109       - xtesting-ci-tests-remote:
110           playbook: '{playbook}'
111           release: '{release}'
112
113 - playbook: &playbook
114     name: 'playbook'
115     playbook:
116       - all
117       - proxy
118       - proxy2
119       - radosgw
120       - nexus
121       - repo
122       - twice
123       - jenkins_2multijobs
124       - branch
125       - jjb
126       - gitlab.insert
127       - jenkins_kind
128       - jenkins_kind2
129       - gitlab_kind
130       - chainedci
131       - kubernetes0
132       - kubernetes1
133       - kubernetes2
134       - proxy_kubernetes
135       - proxy_kubernetes2
136       - k8s_jenkins_kind0
137       - k8s_jenkins_kind1
138       - k8s_jenkins_kind2
139       - k8s_jenkins_kind3
140       - k8s_gitlab0
141       - k8s_gitlab1
142       - k8s_gitlab_kind0
143       - k8s_gitlab_kind1
144       - k8s_gitlab_kind2
145       - k8s_gitlab_kind3
146
147 - project:
148     name: xtesting-ci-tests
149     <<: *playbook
150     node: xtestingci
151     release:
152       - stable
153       - master
154     jobs:
155       - 'xtesting-ci-tests-{release}-{playbook}'
156
157 - project:
158     name: xtesting-ci-tests-remote
159     <<: *playbook
160     node: xtesting
161     release:
162       - stable
163       - master
164     jobs:
165       - 'xtesting-ci-tests-remote-{release}-{playbook}'
166
167 - view:
168     name: xtesting-ci
169     view-type: list
170     columns:
171       - status
172       - weather
173       - job
174       - last-success
175       - last-failure
176       - last-duration
177     regex: ^xtesting-ci-tests-.*$