-
Notifications
You must be signed in to change notification settings - Fork 381
/
.travis.yml
48 lines (41 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
46
47
sudo: required
language: php
services:
- docker
env:
global:
- IMAGE_NAME=restyaplatform/restyaboard
cache:
directories:
- node_modules
jobs:
include:
- stage: test
script:
- npm cache verify
- npm install
- grunt pre-commit
- stage: release
script:
- docker pull "${IMAGE_NAME}:dev"
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
# Direct push to dev
- if [ "$TRAVIS_BRANCH" = "dev" -a "$TRAVIS_PULL_REQUEST" = "false" ]; then
docker build --pull --cache-from "${IMAGE_NAME}:dev" --tag "${IMAGE_NAME}" .;
docker tag "$IMAGE_NAME" "${IMAGE_NAME}:dev";
docker push "${IMAGE_NAME}:dev";
exit 0;
fi
# PullRequests
- if [ "$TRAVIS_PULL_REQUEST" = "true" ]; then
exit 0;
fi
# Tags
- if [ -n "$TRAVIS_TAG" ]; then
docker build --pull --cache-from "${IMAGE_NAME}:dev" --tag "${IMAGE_NAME}" .;
docker tag "$IMAGE_NAME" "${IMAGE_NAME}:$TRAVIS_TAG";
docker push "${IMAGE_NAME}:$TRAVIS_TAG";
exit 0;
fi
# Else
- exit 0;