Merge "Strip include-raw prefix for script files"
[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 latest ansible
21 sudo apt-add-repository ppa:ansible/ansible
22 sudo apt-get update
23 sudo apt-get install -y ansible
24
25 git clone https://github.com/dfarrell07/ansible-opendaylight.git
26 cd ansible-opendaylight
27 sudo ansible-galaxy install -r requirements.yml
28 sudo ansible-playbook -i "localhost," -c local examples/deb_repo_install_playbook.yml
29
30 # Add more tests