-
Notifications
You must be signed in to change notification settings - Fork 22
/
.travis.yml
50 lines (46 loc) · 2.66 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
language: bash
sudo: required
env:
DOCKER_COMPOSE_VERSION: 1.21.2
DOCKER_VERSION: 18.03.1
LC_VERSION: 4.1.0
before_install:
# docker
- sudo apt-get update && sudo apt-get install -y curl apt-transport-https ca-certificates python-software-properties
- sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo apt-key fingerprint 0EBFCD88
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get purge lxc-docker docker docker-engine docker.io
- sudo apt-get install docker-ce=${DOCKER_VERSION}~ce-0~ubuntu
# docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
# elsy
- curl -L https://github.com/cisco/elsy/releases/download/v${LC_VERSION}/lc-linux-amd64-v${LC_VERSION} > lc
- chmod +x lc
- sudo mv lc /usr/local/bin
script:
## need to set GIT_BRANCH and GIT_TAG_NAME for lc, following pattern from: https://graysonkoonce.com/getting-the-current-branch-name-during-a-pull-request-in-travis-ci/
- export PR=https://api.github.com/repos/$TRAVIS_REPO_SLUG/pulls/$TRAVIS_PULL_REQUEST
- export GIT_BRANCH=origin/$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo `curl -s $PR | jq -r .head.ref`; fi)
- export GIT_TAG_NAME=${TRAVIS_TAG}
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, GIT_BRANCH=$GIT_BRANCH GIT_TAG_NAME=$GIT_TAG_NAME"
## blackbox-tests need wide columns when inspecting logs
- stty cols 200
## need to fix above docker-engine install to not require sudo
- travis_wait sudo lc ci
- sudo ./blackbox-test/build-examples.sh
before_deploy:
- sudo chown -R travis:travis target
deploy:
provider: releases
api_key:
secure: x7jhmnBGG6T41Iry3KfDzljAu0GmI9bzEaFCZDN8vUqvdRkkc3q8/DerRM620Yoq8HBK5YIAeFtv+fEpD6jtINcgAaICbyPe63/OSeZxvYZv3yuv9TJLX8HpW9cyRODsTVB4EK2/Ske0QJySR3meuVNsZAx6lruIS8i5sD9c1d2E1LyT+qCSrWB2XM4BRLSOtLJYd1pAMN6AGE+luQaSnARsmPdInHGiTm7fR0y0w6tAXNU93SiQlhLwljJoQtQ1JLqCwsNXLVRZGpnCKL2K+uLy0DoQvvkcJVN1dJLB9FDJ82rWWvicDJ44eUkPSk0mycxnNpCPBoXgVt2nJTjVUSaDJIibHtd25mUOeX2B+SequSbMuF1ktnmhCvFCF8e6YfbHYHfTQtM3kocS4WL5OTgDgT1NQ7RJzx9eJgYFsia9F1/JQrDabcr8rxotF+bLXJS618Fz+FXYNdOrx6Eslcwj3ckmMQZKEb6qdrhDVK/o21e9yf8ol8Yen32p03J6u6J/EyFjOMmGXwdVz+NIBKryLftxOXXoH+6rt2wZ7niyVsTWuH/qu6jE2IkHwloTpQr0ItH8fokMsQ7tT/GeoCnbadb5TQjH9qBHqas8RLvajLUblfafVF2oBYybtaRl2UiqFlXKWHoZk6GzKHIrFxcFUaPkCQyR8V+ZWdzURjY=
skip_cleanup: true
file_glob: true
file: target/lc-*-${TRAVIS_TAG}
on:
repo: cisco/elsy
tags: true