-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.travis.yml
54 lines (47 loc) · 2.81 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
language: generic
sudo: required
services:
- docker
deploy:
provider: packagecloud
repository: "ci"
username: "ergw"
token:
secure: "qvlRcoZmRTkBZ6LKYicpYPGpDIytBvy8mb3LcYaCStHs1/PhTsvo7wNR33NwGUWjynjoiJV/q3cmKCaUyprNd8E7zR2wAotHIxewqHMGI0c76+PVAEX8aZ10F7CYetmf6Gm7wVpNimMMmXTN+PuecxX8A9NKc3CpqMJsBUaCs2wyxOa0fBSdHlcb/ZKllFpiBqbo3acT6zd8ZHDi8H88XHe84GKAF47D5pZVFTZjW2FFQfO57MBp4HgN5JYzQzL48039FTZ4izlfYsqY1A6qUJBy3JyRPabz163vxHBATdl4w8gVbMU3FWLM1TMGHGYAZNoobu0/MhPsvveV+jrLC64nrEq3u3kLkjLJ6iOlKYsQdO2bimR6f0SwvN1ODuJiMkpwCqeC/BTjWKAigfFVl//ZRto3RnP5sFcvo4U/9E+sOS0em6MyrzYO1bjEgrAS+3Bqjt8oJ8voMCmm9brutBJMCqFStzEY4J6b2ubQdqI+9ygUoeSXZJem32NSgplS4TNRwcx9jJw0XYsWUdiyYtCbWrHOFVIGjTAZ+03tb/VZwJlk9XOfGiBZnPjkIuzUfYl0xF/8vuFdwKUkZTCs6qf5QIRsdndDpQoMgrphnVxonBlV0oROM2n459a8Uayy4v/K5E/0f/jaik65Y1ROKTlZfWs7DGaN1iTDxl9mT4k="
dist: "ubuntu/xenial"
skip_cleanup: true
package_glob: artifacts/*.deb
env:
global:
- BUILD_IMAGE="ergw/ergw-capwap-node"
- DOCKER_USERNAME="ergwci"
- secure: "wem2W99LdlqaZy8u7sNJe1ME2uJBIT8/uDtZFuAsz21QdSGkvR5ywvO2DN4wL66JqWw0pi55AlwMZzjStuRI2kBleT6RPBY22k8galsQsMVGhN4bR5wgByIqpj84rj9OlM48pQMf7THjzNF3VH4uUGsKGZS88OE4E37FpAxPgLh/7toQm4yFfP+xtc0S9rl6YsfqHA+cSLveKjvDX6YIp1q0SUrdtz4BhGVjKxtNQ1MMY0hu4LljQUNHXiVXdu/Yhj8aUxsDhsgFf+RhLcNqxVb6lbLbw6ZbhJ/COi/B3GyVVrpIkIGOJq/YQJReHvco8L60cT6kzuyTONAkPdjvuhI0iwvXKOS5Nmh351ovuWNi1E2Qcw3WHYQp25AvrEKoJypt+MOZpCfXjp1/KKrjMIuKBzlfBE1B9lEBj+gibZdAFE910GpJ0oeigXdqeBDXQhBKfk4AxFUz+HqeSO1qph8M/oADJBbW8lGsdy/pmoeGpTTti7Ug53S7YlL09db6QqL991hus2uDqAd6jEHkYucFaraIPWOr0cA4hDt4RAUXpgIm9e6JvRyIceGZ9O0JwRttk/IGe4Xu3xh9jUEi5+UtVADJcgAF1QJ300On4VFg8+fFsQuESU1Mz9s1QQdcEGPyLfV22leBrEy0H850+15rQnjWgWZ6M8dLqSqqyBQ="
before_install:
- sudo apt-get -qq update
- sudo apt-get install -y devscripts
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
- docker build -t ergw -f priv/Dockerfile priv
script:
- echo "build docker image"
- docker version
- docker build -t $BUILD_IMAGE -f docker/Dockerfile --build-arg BUILD_PROFILE=prod+native .
- echo "building docker image - done."
- echo "build deb packages"
- export SHORT_COMMIT_ID=$(git rev-parse --verify --short $TRAVIS_COMMIT)
- debchange -m -l "+$TRAVIS_JOB_NUMBER+git$SHORT_COMMIT_ID" 'Automatically built'
- mkdir artifacts
- docker run -v `pwd`:/build ergw
sh -c "
dpkg-buildpackage -b -uc -nc && cp ../*deb artifacts
"
- echo "build deb packages - done."
after_success:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
- export TAG=`if [ "$TRAVIS_EVENT_TYPE" == "pull_request" ]; then echo PR-$TRAVIS_PULL_REQUEST_BRANCH ; else echo $TRAVIS_BRANCH ; fi`
- if [ "$TAG" == "master" ]; then export TAG="latest"; fi
- docker tag $BUILD_IMAGE $BUILD_IMAGE:$TAG
- docker push $BUILD_IMAGE:$TAG
- echo "docker push done."
branches:
only:
- master