Switch LISP performance CSIT to highcpu VMs
[releng/builder.git] / jjb / packaging / test-ansible-deb.sh
1 #!/bin/bash
2
3 # Options:
4 #   -x: Echo commands
5 #   -e: Fail on errors
6 #   -o pipefail: Fail on errors in scripts this calls, give stacktrace
7 set -ex -o pipefail
8
9 # Install required packages
10 virtualenv deb_build
11 source deb_build/bin/activate
12 PYTHON="deb_build/bin/python"
13 $PYTHON -m pip install --upgrade pip
14
15 # Wait for any background apt processes to finish
16 # There seems to be a backgroud apt process that locks /var/lib/dpkg/lock
17 # and causes our apt commands to fail.
18 while pgrep apt > /dev/null; do sleep 1; done
19
20 # Install Ansible
21 sudo apt-add-repository ppa:ansible/ansible
22 sudo apt-get update
23 sudo apt-get install -y ansible
24
25 # Install local version of ansible-opendaylight to path expected by Ansible.
26 # Could almost do this by setting ANSIBLE_ROLES_PATH=$WORKSPACE, but Ansible
27 # expects the dir containing the role to have the name of role. The JJB project
28 # is called "ansible", which causes the cloned repo name to not match the role
29 # name "opendaylight". So we need a cp/mv either way and this is simplest.
30 sudo cp -R $WORKSPACE/ansible /etc/ansible/roles/opendaylight
31
32 # Install OpenDaylight via repo using example Ansible playbook
33 sudo ansible-playbook -i "localhost," -c local $WORKSPACE/ansible/examples/deb_repo_install_playbook.yml
34
35 # Add more tests