-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
38 lines (31 loc) · 955 Bytes
/
.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
sudo: required
env:
global:
- IMAGE_REPO=mfornasa/test
- DEPLOY_TAG=$IMAGE_REPO:$TRAVIS_COMMIT
- FAST_PATH=""
services:
- docker
before_install:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- wget https://docker-fastpath.s3-eu-west-1.amazonaws.com/releases/linux/docker-fastpath-linux-amd64-latest.tgz
- tar xzvf docker-fastpath-linux-amd64-latest.tgz
- FAST_PATH=$(./fastpath --verbose HEAD $IMAGE_REPO)
install:
- if [ -z "$FAST_PATH" ]; then
echo "New code. Performing a Docker build";
docker build -t $DEPLOY_TAG .;
else
DEPLOY_TAG=$IMAGE_REPO:$FAST_PATH;
echo "Found a suitable image $DEPLOY_TAG";
fi
script:
- if [ -z "$FAST_PATH" ]; then
echo "Do some tests (placeholder)";
fi
after_success:
- if [ -z "$FAST_PATH" ]; then
echo "Pushing $DEPLOY_TAG to the registry";
docker push $DEPLOY_TAG;
fi
- echo "Deploy $DEPLOY_TAG (placeholder)"