-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
73 lines (71 loc) · 2.95 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
dist: trusty
sudo: required
language: python
python: 3.5
matrix:
allow_failures:
- env: JUJU_CHANNEL=candidate
- env: JUJU_CHANNEL=beta
stages:
- lint
- smoke tests
- name: push to charm store
if: branch = master
jobs:
include:
# Linter
- stage: lint
sudo: false
install: pip install tox
before_script: skip
script: make lint
# Smoke tests
- stage: smoke tests
script: make smoke-test
env: JUJU_CHANNEL=stable
- stage: smoke tests
script: make smoke-test
env: JUJU_CHANNEL=candidate
- stage: smoke tests
script: make smoke-test
env: JUJU_CHANNEL=beta
# Push to charm store
- stage: push to charm store
before_script:
# Handle charm store tokens. See bugs below for why this is the way
# https://github.com/juju/charmstore-client/issues/145
# https://github.com/juju/charmstore-client/issues/146
- /snap/bin/charm version
# Make sure /snap/.local/share/juju dir is created
- mkdir -p ~/snap/charm/current/.local/share/juju
# Setup token
- echo $CHARM_STORE_TOKEN | base64 --decode > ~/snap/charm/current/.local/share/juju/store-usso-token
# Login to charm store
- /snap/bin/charm login
- /snap/bin/charm whoami
script: make push
env:
# CHARM_STORE_TOKEN
secure: "CPKQ7m/8jCiChEsBgTIacopx4m8FQDvMqaobsiatxMaZh5HHKyMLIzp+qJouhj7H6pRkcxq3ZXfqQVR3mfrNxB8th48I+MgCZWZHDqwxqNNk2txp/IcnGXyG75adDzR14gBtK9hqL0eUmjT93oa65AwNRAEx3BCO46zjKBlzfPzmJg4PhdstUH1Hw35obPHUW7sgFL5BLzyVJOuhV0imDBoxnks07pS6UQghCeZhnTS+w1e9pu/UgqKfdo89t0znKUqPznF/WiOwPhg2ET2pHK1o8oM6qJMfBPQpLdALReO+wUd66hKl4hy+5DHwVU0EZclUtgYIhOGrjb5DPtvgIZgrcvZyWPigdqQ0WL3Z2Bqg1j/T6JHAZ3UjuXVB0ictDVjDdMCEJE4S6Kd42Zyw/0o+AnIyrXzJVRcplrcrt5EpKeHgqrEUt3u0wcoFqlM579C+VW3Y3qy9Th35ThfoRkkq72H5aOReFWtPdsny7D86gXlVBc7UzKAgVOaZyo4UfDv1f7vxqdiv+DHFeX2peyzUwiHYCj2Ay99WMzweNO4Y8RaN30+28vlsPVO9PElfwwnx0rg89MrGqo6s199GCQZ0Ui16LvEz/9JwoD585Sg50jsD6C/qI/Q5+1PN1mvQkLum1cT0YFN790qGEhILeAi24TfUvhot7PiBDPTXlmg="
install:
# Add lxd repository as travis only has 14.04
- sudo add-apt-repository -y ppa:ubuntu-lxc/lxd-stable
- sudo apt-get -qq update
# Install packages
- sudo apt-get -y install lxd snapd python-tox
- sudo snap install juju --classic --channel=$JUJU_CHANNEL
# Install candidate version of charm due to https://github.com/juju/charm-tools/issues/356
- sudo snap install charm --candidate
# Setup LXD
- sudo service lxd start
- sudo lxd init --auto
- sudo usermod -a -G lxd travis
# Changing user as a workaround for https://github.com/travis-ci/travis-ci/issues/1839
# See http://fnordahl.com/2017/04/08/continuous-deployment-testing-of-github-hosted-code/
- sudo su travis -c 'lxc network create lxdbr0'
- sudo su travis -c 'lxc network attach-profile lxdbr0 default eth0'
before_script:
# Bootstrap juju
- sudo su travis -c '/snap/bin/juju bootstrap localhost'
notifications:
email: false