forked from symbol/catapult-rest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
45 lines (41 loc) · 1.34 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
language: node_js
node_js:
- "12"
services:
- docker
- mongodb
env:
global:
- RELEASE_BRANCH=main
- POST_RELEASE_BRANCH=main
- RELEASE_MESSAGE=release
matrix:
- SUBPROJECT=catapult-sdk
- SUBPROJECT=rest
- SUBPROJECT=spammer
cache: yarn
before_script:
- . ./travis/docker-functions.sh
- log_env_variables
- echo '$SUBPROJECT'
- mongo mydb_test --eval 'db.createUser({user:"travis",pwd:"test",roles:["readWrite"]});'
- if [[ ! -z "$DOCKER_USERNAME" ]] ; then echo "${DOCKER_PASSWORD}" | docker login -u "${DOCKER_USERNAME}" --password-stdin; fi
- sh yarn_setup.sh
script: cd ${SUBPROJECT} && yarn run lint && yarn run test:travis && cd ..
jobs:
include:
- stage: test
name: docker test build
script: docker_build $(load_version_from_file)
- stage: publish
name: docker publish alpha
script: docker_build $(load_version_from_file) publish
if: branch = env(DEV_BRANCH) AND type = push
- stage: release
name: docker publish release
script: docker_build $(load_version_from_file) release
if: branch = env(RELEASE_BRANCH) AND type = api AND commit_message = env(RELEASE_MESSAGE)
- stage: post release
name: tag and version upgrade
script: post_release_version_file
if: branch = env(RELEASE_BRANCH) AND type = api AND commit_message = env(RELEASE_MESSAGE)