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