File tree 4 files changed +26
-1
lines changed
4 files changed +26
-1
lines changed Original file line number Diff line number Diff line change
1
+ sshpass [epel]
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env python
2
2
3
+ import os
3
4
import random
4
5
import string
5
6
@@ -14,6 +15,13 @@ def main():
14
15
ec2_name_prefix: %s
15
16
""" % (admin_password , ec2_name_prefix ))
16
17
18
+ change_id = os .getenv ('WORKSHOPS_CHANGE_ID' )
19
+ if change_id :
20
+ with open ('provisioner/tests/ci-common.yml' , 'a' ) as f :
21
+ f .write ("""ansible_workshops_refspec: +refs/pull/%s/head:refs/remotes/origin/PR-%s
22
+ ansible_workshops_version: PR-%s
23
+ """ % (change_id , change_id , change_id ))
24
+
17
25
18
26
if __name__ == '__main__' :
19
27
main ()
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ set -eu
4
+
5
+ DEPLOYMENT_NAME=$( grep ' ec2_name_prefix' provisioner/tests/ci-common.yml | cut -d' ' -f2)
6
+ ADMIN_PASSWORD=$( grep ' admin_password' provisioner/tests/ci-common.yml | cut -d' ' -f2)
7
+
8
+ CONTROL_NODE_HOST=$( grep -A 1 control provisioner/${DEPLOYMENT_NAME} /student1-instances.txt | tail -n 1 | cut -d' ' -f 2 | cut -d' =' -f2)
9
+
10
+ RUN_ALL_PLAYBOOKS_CMD=' find . -name "*.yml" -o -name "*.yaml" | grep -v "2.0" | sort | xargs -I {} bash -c "echo {} && ANSIBLE_FORCE_COLOR=true ansible-playbook {}"'
11
+
12
+ sshpass -p " ${ADMIN_PASSWORD} " ssh -o StrictHostKeyChecking=no student1@${CONTROL_NODE_HOST} " cd networking-workshop && ${RUN_ALL_PLAYBOOKS_CMD} "
Original file line number Diff line number Diff line change @@ -12,7 +12,9 @@ commands =
12
12
13
13
[testenv:workshops]
14
14
sitepackages = True
15
- whitelist_externals = ansible-playbook
15
+ whitelist_externals =
16
+ ansible-playbook
17
+ bash
16
18
deps =
17
19
ansible
18
20
netaddr
@@ -27,6 +29,7 @@ setenv =
27
29
passenv =
28
30
AWS_ACCESS_KEY
29
31
AWS_SECRET_KEY
32
+ WORKSHOPS_CHANGE_ID
30
33
commands_pre =
31
34
python provisioner/tests/generate_ci_common.py
32
35
@@ -96,6 +99,7 @@ commands =
96
99
-e @provisioner/tests/vars.yml \
97
100
-e @provisioner/tests/ci-common.yml \
98
101
-e @provisioner/tests/ci-f5.yml
102
+ bash ./provisioner/tests/verify-f5.sh
99
103
commands_post =
100
104
ansible-playbook provisioner/teardown_lab.yml \
101
105
-e @provisioner/tests/vars.yml \
You can’t perform that action at this time.
0 commit comments