-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
74 lines (66 loc) · 2.4 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
74
language: bash
sudo: required
services:
- docker
defaults: &defaults
before_script:
- export BUILD_DATE=$(date '+%d/%m/%Y %T UTC' -u)
- docker pull $USERNAME/$IMAGE_NAME:$TAG || true
script:
- docker build --cache-from $USERNAME/$IMAGE_NAME:$TAG --build-arg BUILD_DATE="${BUILD_DATE}" --build-arg TRAVIS_COMMIT="${TRAVIS_COMMIT}" --tag $USERNAME/$IMAGE_NAME:$TRAVIS_COMMIT --tag $USERNAME/$IMAGE_NAME:$TAG -f $DOCKERFILE .
after_script:
- docker images
before_deploy:
- echo $PASSWORD | docker login docker.io -u $USERNAME --password-stdin
deploy:
provider: script
script:
- docker push $USERNAME/$IMAGE_NAME:$TRAVIS_COMMIT && docker push $USERNAME/$IMAGE_NAME:$TAG
on:
branch: master
after_deploy:
- bash post_script.sh
jobs:
include:
- stage: Build Primary Images
env:
- IMAGE_NAME=tomcat-r
- TAG=latest
- DOCKERFILE=stage_1_primary_images/r.dockerfile
- LINK_BADGER=https://hooks.microbadger.com/images/autimio/tomcat-r/inwV-kTlqCkxV6WFWesIGRh-cWo=
<<: *defaults
-
env:
- IMAGE_NAME=tomcat-gdal
- TAG=latest
- DOCKERFILE=stage_1_primary_images/gdal.dockerfile
- LINK_BADGER=https://hooks.microbadger.com/images/autimio/tomcat-gdal/z5hoezHBR5xvReNMYl0iH3H50mA=
<<: *defaults
-
env:
- IMAGE_NAME=tomcat-grass
- TAG=latest
- DOCKERFILE=stage_1_primary_images/grass.dockerfile
- LINK_BADGER=https://hooks.microbadger.com/images/autimio/tomcat-grass/D8v8B4fyb_gjaHH06xGkEBNwbEY=
<<: *defaults
-
env:
- IMAGE_NAME=tomcat-postgresql
- TAG=latest
- DOCKERFILE=stage_1_primary_images/postgresql.dockerfile
- LINK_BADGER=https://hooks.microbadger.com/images/autimio/tomcat-postgresql/p646B2SYb4WqzhF_NY3i5-5vnAU=
<<: *defaults
- stage: Build Secondary Images
env:
- IMAGE_NAME=tomcat-gdal
- TAG=grass
- DOCKERFILE=stage_2_secondary_images/gdal_grass.dockerfile
- LINK_BADGER=https://hooks.microbadger.com/images/autimio/tomcat-gdal/z5hoezHBR5xvReNMYl0iH3H50mA=
<<: *defaults
-
env:
- IMAGE_NAME=tomcat-gdal
- TAG=postgres
- DOCKERFILE=stage_2_secondary_images/gdal_postgresql.dockerfile
- LINK_BADGER=https://hooks.microbadger.com/images/autimio/tomcat-gdal/z5hoezHBR5xvReNMYl0iH3H50mA=
<<: *defaults