-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.travis.yml
51 lines (43 loc) · 2.36 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
env:
global:
- INVENTORY_IMAGE_REPO=coolstore/inventory
- WEB_IMAGE_REPO=coolstore/web
- CATALOG_IMAGE_REPO=coolstore/catalog
- SPRING_GATEWAY_IMAGE_REPO=coolstore/gateway-spring
- VERTX_GATEWAY_IMAGE_REPO=coolstore/gateway-vertx
cache:
directories:
- $HOME/.m2
services:
- docker
language: java
jdk:
- oraclejdk8
before_install:
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- cp .travis.settings.xml $HOME/.m2/settings.xml
- curl -sL -o $HOME/s2i.tar.gz https://github.com/openshift/source-to-image/releases/download/v1.1.9/source-to-image-v1.1.9-db2b4645-linux-amd64.tar.gz
- pushd $HOME/bin && tar xvfz $HOME/s2i.tar.gz && popd
script:
# - mvn -f catalog package
# - export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo $TRAVIS_BRANCH ; fi`
# - export PROD_TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "prod"; else echo "$TRAVIS_BRANCH-prod" ; fi`
# - ${HOME}/bin/s2i build ./inventory centos/nodejs-8-centos7 $INVENTORY_IMAGE_REPO:latest
- docker build -t inventory inventory && docker tag inventory:latest $INVENTORY_IMAGE_REPO:latest && docker push $INVENTORY_IMAGE_REPO:latest
- docker build -t catalog catalog && docker tag catalog:latest $CATALOG_IMAGE_REPO:latest && docker push $CATALOG_IMAGE_REPO:latest
- ${HOME}/bin/s2i build ./web centos/nodejs-8-centos7 $WEB_IMAGE_REPO:latest
# - ${HOME}/bin/s2i build ./catalog centos/nodejs-8-centos7 $CATALOG_IMAGE_REPO:latest
# - docker tag $INVENTORY_IMAGE_REPO:latest $INVENTORY_IMAGE_REPO:$PROD_TAG
# - docker tag $WEB_IMAGE_REPO:latest $WEB_IMAGE_REPO:$PROD_TAG
#- docker push $INVENTORY_IMAGE_REPO:latest
# - docker push $INVENTORY_IMAGE_REPO:$PROD_TAG
- docker push $WEB_IMAGE_REPO:latest
# - docker push $WEB_IMAGE_REPO:$PROD_TAG
# - docker push $CATALOG_IMAGE_REPO:latest
# - cp -R solutions/lab-2/catalog/* catalog/ && mvn -f catalog package
# - cp -R solutions/lab-3/catalog/* catalog/ && mvn -f catalog package
# - mvn -f gateway-spring clean package
- ${HOME}/bin/s2i build ./gateway-spring registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift:1.3 $SPRING_GATEWAY_IMAGE_REPO:latest
- docker push $SPRING_GATEWAY_IMAGE_REPO:latest
- ${HOME}/bin/s2i build ./gateway-vertx registry.access.redhat.com/redhat-openjdk-18/openjdk18-openshift:1.3 $VERTX_GATEWAY_IMAGE_REPO:latest
- docker push $VERTX_GATEWAY_IMAGE_REPO:latest