diff --git a/.travis.yml b/.travis.yml index 0e40c7f13..d209f9622 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,7 @@ before_script: # Use Travis retry feature for farm tests since they are flaky - 'if [[ "$TOXENV" == "travis-test-farm"* ]]; then export TRAVIS_RETRY=travis_retry; fi' - export TOX_TESTENV_PASSENV=TRAVIS + - 'if [[ "$SNAP" == true ]]; then snap/local/build_and_install.sh; fi' # Only build pushes to the master branch, PRs, and branches beginning with # `test-`, `travis-test-`, or of the form `digit(s).digit(s).x`. This reduces @@ -224,14 +225,7 @@ matrix: - libaugeas0 <<: *extended-test-suite - sudo: required - env: TOXENV=integration-external,apacheconftest-external-with-pebble - before_install: - - sudo /snap/bin/lxd.migrate -yes - - sudo /snap/bin/lxd waitready - - sudo /snap/bin/lxd init --auto - - tools/strip_hashes.py letsencrypt-auto-source/pieces/dependency-requirements.txt > constraints.txt - - sudo snapcraft --use-lxd - - sudo snap install --dangerous --classic *.snap + env: SNAP=true TOXENV=integration-external,apacheconftest-external-with-pebble addons: snaps: - name: snapcraft diff --git a/snap/local/build_and_install.sh b/snap/local/build_and_install.sh new file mode 100644 index 000000000..e21ecce89 --- /dev/null +++ b/snap/local/build_and_install.sh @@ -0,0 +1,9 @@ +#!/bin/bash +set -ex + +sudo /snap/bin/lxd.migrate -yes +sudo /snap/bin/lxd waitready +sudo /snap/bin/lxd init --auto +tools/strip_hashes.py letsencrypt-auto-source/pieces/dependency-requirements.txt > constraints.txt +sudo snapcraft --use-lxd +sudo snap install --dangerous --classic *.snap