-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
33 lines (30 loc) · 1.33 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
language: minimal
branches:
only:
- master
- /v\d+\.\d+.\d+/
services:
- docker
script:
- set -eo pipefail
# Building the Docker image
- docker build --pull --build-arg BUILD_TIMESTAMP=$(date -u +'%Y-%m-%dT%H:%M:%SZ') --build-arg COMMIT_ID="${TRAVIS_COMMIT}" -t "jsii/superchain:nightly" ./superchain
# Building jsii itself within the Docker image
- docker run --rm -it --net=host -v ${PWD}:${PWD} -w ${PWD} jsii/superchain:nightly npm run build
# Make sure the build did not change the source tree
- git update-index --refresh
- git diff-index --exit-code --stat HEAD
- untracked=$(git ls-files --others --exclude-standard) && echo "${untracked}" && test -z "${untracked}"
# Publish the image to DockerHub when relevant
- echo "TRAVIS_PULL_REQUEST = ${TRAVIS_PULL_REQUEST:-}"
- echo "TRAVIS_TAG = ${TRAVIS_TAG:-}"
- echo "TRAVIS_BRANCH = ${TRAVIS_BRANCH:-}"
- >-
if [ ${TRAVIS_PULL_REQUEST} = false ] && [ ! -z "${DOCKER_USERNAME+SET}" ] && [ ! -z "${DOCKER_PASSWORD+SET}" ]; then
echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin
docker push jsii/superchain:nightly
if [ "${TRAVIS_TAG:-}" = "${TRAVIS_BRANCH}" ]; then
docker tag jsii/superchain:nightly jsii/superchain:latest
docker push jsii/superchain:latest
fi
fi