2018-04-04 10:00:24 +00:00
|
|
|
#!/bin/bash -ex
|
|
|
|
# Run some invocations of DebOps.
|
|
|
|
|
|
|
|
TMPDIR="/tmp/debops-$$"
|
|
|
|
TRAVIS_BUILD_DIR="${TRAVIS_BUILD_DIR:-`pwd`}"
|
|
|
|
|
|
|
|
function on_exit()
|
|
|
|
{
|
|
|
|
[ "$KEEP" ] || {
|
|
|
|
rm -rvf "$TMPDIR" || true
|
|
|
|
docker kill target || true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
trap on_exit EXIT
|
|
|
|
mkdir "$TMPDIR"
|
|
|
|
|
2018-04-04 11:47:53 +00:00
|
|
|
|
|
|
|
echo travis_fold:start:docker_setup
|
2018-04-04 10:00:24 +00:00
|
|
|
docker run --rm --detach --name=target d2mw/mitogen-test /bin/sleep 86400
|
2018-04-04 11:47:53 +00:00
|
|
|
echo travis_fold:end:docker_setup
|
|
|
|
|
2018-04-04 10:00:24 +00:00
|
|
|
|
2018-04-04 11:47:53 +00:00
|
|
|
echo travis_fold:start:job_setup
|
2018-04-04 10:00:24 +00:00
|
|
|
pip install -U debops==0.7.2 ansible==2.4.3.0
|
|
|
|
debops-init "$TMPDIR/project"
|
|
|
|
cd "$TMPDIR/project"
|
|
|
|
|
|
|
|
cat > .debops.cfg <<-EOF
|
|
|
|
[ansible defaults]
|
|
|
|
strategy_plugins = ${TRAVIS_BUILD_DIR}/ansible_mitogen/plugins/strategy
|
|
|
|
strategy = mitogen_linear
|
|
|
|
EOF
|
|
|
|
|
2018-04-04 11:30:48 +00:00
|
|
|
cat > ansible/inventory/host_vars/target.yml <<-EOF
|
|
|
|
ansible_connection: docker
|
|
|
|
ansible_python_interpreter: /usr/bin/python2.7
|
|
|
|
|
|
|
|
# Speed up slow DH generation.
|
2018-04-04 11:35:07 +00:00
|
|
|
dhparam__bits: ["128", "64"]
|
2018-04-04 10:00:24 +00:00
|
|
|
EOF
|
|
|
|
|
2018-04-04 11:30:48 +00:00
|
|
|
echo target >> ansible/inventory/hosts
|
2018-04-04 11:47:53 +00:00
|
|
|
echo travis_fold:end:job_setup
|
|
|
|
|
|
|
|
|
|
|
|
echo travis_fold:start:first_run
|
|
|
|
/usr/bin/time debops common
|
|
|
|
echo travis_fold:end:first_run
|
|
|
|
|
|
|
|
|
|
|
|
echo travis_fold:start:second_run
|
|
|
|
/usr/bin/time debops common
|
|
|
|
echo travis_fold:end:second_run
|