forked from HSLdevcom/transitdata-tripupdate-processor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
45 lines (38 loc) · 1.18 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
sudo: required
language: java
jdk:
- openjdk8
services:
- docker
addons:
apt:
packages:
# Needed for `xmllint`.
- libxml2-utils
env:
global:
# Docker Hub cannot handle uppercase characters in repository names. Fix it
# with a bashism as Travis CI cannot handle quoting within command
# substitution.
- LOWERCASE_REPO_SLUG="${TRAVIS_REPO_SLUG,,}"
- DOCKER_LOCAL="${LOWERCASE_REPO_SLUG}:${TRAVIS_COMMIT}"
- DOCKER_DEV_TAG="${LOWERCASE_REPO_SLUG}:develop"
- BUILD_HASH=$(echo "${TRAVIS_COMMIT}" | cut -c1-7)
before_install:
- docker --version
- echo "ENV GIT_COMMIT ${TRAVIS_COMMIT}" >> Dockerfile
script:
- set -e
- ./.travis/check_semver
- docker build --tag "${DOCKER_LOCAL}" .
# develop-branch pushes the image with "develop"-tag. Tagged commit will push the image with fully versioned tags
deploy:
- provider: script
script: sh ./.travis/docker_login_tag_push "${DOCKER_LOCAL}" "${DOCKER_DEV_TAG}"
on:
branch: develop
- provider: script
script: sh ./.travis/docker_login_tag_semver_push "${DOCKER_LOCAL}" "${LOWERCASE_REPO_SLUG}" "${TRAVIS_TAG}" "${BUILD_HASH}"
on:
tags: true
all_branches: true