-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
57 lines (53 loc) · 2.13 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
jobs:
include:
- language: java
name: "Backend"
stage: build
cache:
directories:
- $HOME/.m2
- $HOME/google-cloud-sdk
install:
- if [ ! -d "$HOME/google-cloud-sdk/bin" ]; then rm -rf $HOME/google-cloud-sdk; export CLOUDSDK_CORE_DISABLE_PROMPTS=1; curl https://sdk.cloud.google.com | bash; fi
- source $HOME/google-cloud-sdk/path.bash.inc
- gcloud version
- gcloud --quiet components update app-engine-java
#command to install dependencies
script:
- cd $TRAVIS_BUILD_DIR/liste-envies-war
- echo ${FIREBASE_SERVICE_ACCOUNT} > $TRAVIS_BUILD_DIR/liste-envies-war/src/main/resources/firebase.json
- "mvn -B --no-transfer-progress -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=error clean test"
- language: node_js
stage: build
name: "Frontend"
node_js:
- 12
cache:
directories:
- $TRAVIS_BUILD_DIR/liste-envies-front/node_modules
install:
- cd $TRAVIS_BUILD_DIR/liste-envies-front
- npm install
#command to install dependencies
script:
- cd $TRAVIS_BUILD_DIR/liste-envies-front
- npm run build
- language: java
stage: deploy
name: "Deploy"
script:
- cd $TRAVIS_BUILD_DIR/liste-envies-war
- if [ a${TRAVIS_BRANCH} = "amaster" -a ${TRAVIS_EVENT_TYPE} = "push" ]; then
echo ${GOOGLE_CLIENT_SECRET} > client-secret.json;
export APP_ID=${CLOUDSDK_CORE_PROJECT};
export APP_VERSION=${VERSION_CORE_NAME};
else
echo ${GOOGLE_CLIENT_SECRET_TEST} > client-secret.json;
export APP_ID=${CLOUDSDK_TEST_PROJECT};
export APP_VERSION=${TRAVIS_BRANCH//_/-};
fi
- echo "Deploy application ${APP_ID} version ${APP_VERSION}"
- gcloud auth activate-service-account --key-file client-secret.json
- mvn -B -DskipTests=true -Dapp.deploy.project=${APP_ID} -Dapp.deploy.version=${APP_VERSION} -Dapp.deploy.promote=false appengine:deploy
notifications:
slack: desaintsteban:OBrvC8hmnZXdW1HTa0QOE5tM