This repository has been archived by the owner on Jan 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy path.travis.yml
108 lines (99 loc) · 3.64 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
language: generic
# Build only commits on master and release tags for the "Build pushed branches" feature.
# This prevents building twice on PRs originating from our repo ("Build pushed pull requests)".
# See:
# - https://github.com/travis-ci/travis-ci/issues/1147
# - https://docs.travis-ci.com/user/pull-requests/#double-builds-on-pull-requests
branches:
only:
- master
- /v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$/
jdk:
- openjdk8
services: docker
env:
global:
- PSD2_SANDBOX_IMAGE="psd2-sandbox"
- SSL_PROXY_IMAGE="psd2-sandbox-ssl-proxy"
- NPM_CONFIG_CACHE="$HOME/.npm"
- OPENSHIFT_REGISTRY="openshift-registry.adorsys.de"
- OPENSHIFT_NAMESPACE_STATIC_SANDBOX_DEV="psd2-sandbox-dev"
- OPENSHIFT_NAMESPACE_DYNAMIC_SANDBOX_DEV="adorsys-dynamic-sandbox-dev"
- OPENSHIFT_NAMESPACE_DYNAMIC_SANDBOX_INTEG="adorsys-dynamic-sandbox-integ"
- OPENSHIFT_NAMESPACE_DYNAMIC_SANDBOX_DEMO="adorsys-dynamic-sandbox-demo"
cache:
directories:
- "$HOME/.npm"
- "$HOME/.m2"
before_install:
- nvm install --lts
- nvm use --lts
script:
# build ui
- cd ui || travis_terminate 1
- npm ci || travis_terminate 1
- npm run tslint || travis_terminate 1
- npm run prettier-check || travis_terminate 1
- npm run test-ci || travis_terminate 1
- npm run build -- --prod || travis_terminate 1
- cd -
# build service
- mvn -f service/pom.xml -B clean package || travis_terminate 1
- cd service/sandbox-core/target || travis_terminate 1
- sha1sum *.jar | tee $(ls *.jar).sha1 || travis_terminate 1
- cd -
# build docker
- docker build --pull -t "adorsys/$PSD2_SANDBOX_IMAGE:latest" service/sandbox-core || travis_terminate 1
- docker build --pull -t "adorsys/$SSL_PROXY_IMAGE:latest" ssl-proxy || travis_terminate 1
- docker run -it --rm -v $PWD:/src -w /src -u $(id -u ${USER}):$(id -g ${USER})
adorsys/arc42-tools sh -c "make arc42/psd2-accelerator-arc42.html" || travis_terminate 1
# assemble arc42 and license for pages
- mkdir pages || travis_terminate 1
- cp -r arc42/images pages || travis_terminate 1
- cp arc42/psd2-accelerator-arc42.html pages/index.html || travis_terminate 1
- cp arc42/psd2-accelerator-deployment.html pages/deployment.html || travis_terminate 1
- mkdir pages/licenses || travis_terminate 1
- cp -r service/sandbox-core/target/site/css pages/licenses || travis_terminate 1
- cp -r service/sandbox-core/target/site/images pages/licenses || travis_terminate 1
- cp service/sandbox-core/target/site/dependencies.html pages/licenses/index.html || travis_terminate 1
# sonar cloud
- cd service
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent install sonar:sonar -Dsonar.projectKey=adorsys_psd2-accelerator
addons:
sonarcloud:
organization: "adorsys"
token: ${SONARCLOUD_TOKEN}
deploy:
# master
- provider: script
skip_cleanup: true
script: bash infrastructure/build/deploy.sh latest
on:
branch: master
# release to dockerhub
- provider: script
skip_cleanup: true
script: bash infrastructure/build/deploy.sh $TRAVIS_TAG
on:
tags: true
condition: '$TRAVIS_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$'
# create release draft with JAR on github
- provider: releases
api_key: $GITHUB_RELEASE_TOKEN
skip_cleanup: true
file_glob: true
file:
- service/sandbox-core/target/*.jar
- service/sandbox-core/target/*.jar.sha1
draft: true
on:
tags: true
condition: '$TRAVIS_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-.*)?$'
# deploy www content to github pages
- provider: pages
skip-cleanup: true
github-token: $GITHUB_PAGES_TOKEN
keep-history: false
local-dir: pages
on:
branch: master