-
Notifications
You must be signed in to change notification settings - Fork 36
/
.travis.yml
65 lines (62 loc) · 2.11 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
sudo: required
language: node_js
addons:
apt:
# needed for cypress https://github.com/cypress-io/cypress/issues/1526
packages:
- libgconf-2-4
node_js:
- "10"
cache:
bundler: false
yarn: true
directories:
- .build-cache
- ~/.cache
git:
submodules: false
install: yarn install --frozen-lockfile --non-interactive --audit --silent
jobs:
include:
- stage: test
name: "Unit tests and code checks"
script: |
set -e
if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]
then
export NX_BASE=$(git rev-parse HEAD~1)
else
export NX_BASE="remotes/origin/$TRAVIS_BRANCH"
fi
echo "Base => $NX_BASE"
yarn format:check --base=$NX_BASE
yarn nx affected --target=lint --base=$NX_BASE --head=HEAD --parallel
yarn nx affected --target=test --all --parallel
- stage: test
name: "E2E tests"
script: yarn e2e:ci
- stage: build
language: bash
name: "Build the docker image"
node_js:
services:
- docker
install: skip
script: |
RELEASE_VERSION=latest ./make-web.sh --build-ml
if [ "${TRAVIS_BRANCH}" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
echo 'Master banch build detected, pushing to docker hub'
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker tag flogo/flogo-web:latest flogo/flogo-docker:unstable
docker push flogo/flogo-docker:unstable
docker tag flogo/flogo-web:latest-ml flogo/flogo-docker:unstable-ml
docker push flogo/flogo-docker:unstable-ml
fi
if [ ! -z "$TRAVIS_TAG" ]; then
echo "Tag detected, pushing tag '${TRAVIS_TAG}' to docker hub"
docker tag flogo/flogo-web:latest "flogo/flogo-docker:${TRAVIS_TAG}"
docker tag flogo/flogo-web:latest "flogo/flogo-docker:latest"
echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
docker push "flogo/flogo-docker:${TRAVIS_TAG}"
docker push "flogo/flogo-docker:latest"
fi