-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
71 lines (56 loc) · 1.92 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
sudo: required
language: dart
dart:
# Install the latest stable release
- stable
env:
global:
- CURRENT=$(pwd)
- GITHUB_REPOSITORY=github.com/bwnyasse/led.git
- DOCKER_REPOSITORY=bwnyasse/led
- DOCKER_COMPOSE_VERSION=1.8.0
# LED build version - also used to tag github repo and docker hub image
- VERSION=0.8.0-SNAPSHOT
services:
- docker
before_install:
# Check current docker engine version
- docker --version
# Installing docker-compose
- sudo rm /usr/local/bin/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
# set env vars in the build settings to interact with repositories
# see https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings
- echo "Testing Docker Hub credentials"
- docker login -u=$DOCKER_USERNAME -p=$DOCKER_PASSWORD
# install maven
- sudo apt-get install maven
before_install:
# update UI
- ./bin/build_ui.sh
# build server
- ./bin/build_server.sh
install:
- cd $CURRENT/images/led
- docker pull ${DOCKER_REPOSITORY}:latest || true
- docker build -t ${DOCKER_REPOSITORY} --pull=true --build-arg version=${VERSION} .
- docker build -t ${DOCKER_REPOSITORY}:${VERSION} --build-arg version=${VERSION} .
script:
- cd $CURRENT/integ/dev
- docker-compose -f led.yml up --build --force-recreate --remove-orphans -d
- docker-compose -f service.yml up --build --force-recreate -d
- count=$(docker ps -aq -f status="running" -s | wc -l)
- if [[ $count != 3 ]]; then echo "Expected 3 running containers" && exit 1 ; fi
- cd $CURRENT
before_deploy:
# CREATE GIT TAG
- ./bin/github.sh
deploy:
# Deploy to docker hub
provider: script
script: ./bin/dockerhub.sh
skip_cleanup: true
on:
all_branches: true