-
Notifications
You must be signed in to change notification settings - Fork 1
/
.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: "Ep4s92VQgDIAzEtF3VdOhxx5HLpVsyTmzbhBGOm4hIXfHyqjNgcf4lW5frPKcMg6ZdkeSKDjGWmR5LRoagy2AnKo8CNnr9vIjKGmEYqxkn+Xr2CbFv4HwVeNUpNjUUrT4thQWAAP0hYAkzVK8oayjoFl+loFGT6LtIPW2OTfDgV+Gj49WxfAsqQSmGUOhyRcC2vM57BzMwIk60nWgaJGgRlDWP0wMmdK0rSWXwVAlNZUx+e/uGyv1f7QIV8Fhiw1MyAeuKGm1J/AeBDxG9IcX6Gcks3ylmFwdPWOi85d9QebpOfm6zoma8uimIznz0RhzrwBEqU0HDpHy2LGwrYJBtxDKs48zXKzo6Sa6sL0N3fxM6Oj/0O8etiFQK9Qzr4y3lJ3jB+A7CigIWGRJPcbDwWQowoTCXOtvbPy+Pgc6JwwnoR19ouYSHyQjb5JIAuwUZnVoqqqLwgKnyu1s+DNG8M1YWG4BFcO2gcicLF8T6Ts6s667ZGV2Om3DMmkf1Nk2rI/u3vUbgSCHER/hEVhnK75xVRvSoG+JDqWsKQHHTaHRRTcayshCP/qdE0Ecl1RX45HNr6jeP7L3RcdhNSSu6NM+JNAmG2a1fhuGR4u0rutobK4ywJALOgAqRKG4d7lK1eYHFZZTffKhi9MbDdLBJk0fXjN4dqvDP+MTeCzda4="
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