-
Notifications
You must be signed in to change notification settings - Fork 24
/
.travis.yml
139 lines (120 loc) · 5.55 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# Using bash because Travis CI does not support Java on Windows
sudo: required
services:
- docker
branches:
except:
- gh-pages
env:
global:
# This is a convenience variable for shortening download commands
- GRAVIS="https://raw.githubusercontent.com/DanySK/Gravis-CI/master/"
- JDK="[email protected]"
# DOCKERHUB_USER
- secure: "VfQm2li2nQueRUtyVnV+BDaIjp27ydXltWsoYIZha0MdkItAnhdmQSvICKjD1PCr4kI17o1lPnUPhX1khBUWpQftPFCAcD1bbeAW0AHRVtF2fWL460R+o3C93jqlqKYczo7DWr4nKaMQ0HDZEGa1QcMuyeQA1S4CGdPmrkHk3N5PAflFF1myrCUSCzqV8+lp0w4CxCdScVYGYlQwahdLHrLNZbCo/Nxiex5XrOYrqLTaU98EoxmKlZaR4klg2/pJENgZ6NbZb8JfFaPkEYsmF5z4w2Cf5mp9PPJLnBuKLO/zhKTXpjz2hjhGpncEqFTHrxIpoY/jFrewB5t09a9lykpFHlXpvujZq1S7xNzOBTj9X6TnU4oyK1oteb6CW9A+hpyJVPPMQ2JrrkKzTaEQpel5q45unthStdvAVvl/BjrjVpzffbnaLXKomTzKjuW7VW3Q5mVIRD7UBVAn2izszaN2Lp05JKKxk+aYAsvywCL/bopI/nsugZz9mOhTFq7uf2Cvj6Ku6Hmzh/7fp/0no0tLr251a9nN7yoe2xbwL/524lnyQd2lHcwWfleCbwPFoZUtg+qBUXqf0EiRp6xj7fnl3kK/crXWcsWyrru33EgbRjuRzZVA2ShGVs9Yb8cKalXHouZ2deWwhxuk+Kb5BR8DM3PY9ThUZSU6tv4V0RY="
# DOCKERHUB_PASS
- secure: "wvFxLpbykOGuiuqqRUhsR/A9ErCSRO5GzRGxj/9wjehl6jQOQTAmN3Dtk3uO9cS/RfXjLpPZcJ4IVQ9QbEd/HCfJ46CzRfyMwCb8vP2N/wUiSqsun/0ev4lviOfI0j0vciKuB8VeWg5/ASfjznfehPcexOgOfbG61Apv7KS76SsfNLEiGFbszrq8tD1bVsdpT9CT+SiqpI1PCv1PIvQaC0CBkjCGNKbTGc1H4Hrd+OzVMP8qT/BkuSNxtvZABaRFht5+aF47X6M3PsqbOCHe1kiMkk5OHtQ0CRMJM/gP4xsQcR6bk5QTYmJZF7qD1tSXRzL8Yo3UbgBW3xz/eftDPCmbRRHBCPICjHle2w3jowgtOlkNtyeJJbz6yWSL1+ZOljuFHTiXIkXE+EAW/4CMroWH4EuzWo/2XeZCmkRmZe0dTxaMhrFLwXq0SJG/CaOP3mNSf04bNd/voga/zdD3jBMGPebEbwqoYvdXE/4sj6f0THznjvroT4AyrDvHkrBA78X3eeK/JPVyRtpbLsybVLoaxWha4rDgS4Dk5K/9uQqRJJruiSGZeBxLhA4yw+8M+KqIh7CV4gy1DZZspiZ5ST3AyY8K7OSMp7948awhy9xSJW7Hue7CoHBrDaJ59LEs4rE8JTU/HmcOLU+JA/J9hqOHEzFvyj4OFdb0h6gShoo="
### This section represents primary build actions
before_install:
- curl -L https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz > oc-cli.tar.gz
- tar -xzf oc-cli.tar.gz
- sudo mv ./openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit/oc /usr/local/bin
# preparations to build frontend
install:
- nvm install 12.0
- npm install -g @angular/cli
- cd frontend/datasafe-ui && npm install && cd ../..
script:
- mvn --settings .travis/settings.xml clean verify -B -V -DAWS_BUCKET=${AWS_BUCKET}
# make frontend available for REST-docker
- cd frontend/datasafe-ui && ng build --deploy-url /static/ --base-href /static/ && mv dist ../../datasafe-rest-impl/target/dist && cd ../..
deploy:
- provider: script
skip_cleanup: true
script: /bin/bash .travis/deploy.sh
on:
tags: true
condition: "$TRAVIS_TAG =~ ^v([[:digit:]]+\\.)+[[:digit:]]+(-[[:digit:]]+)?(-SNAPSHOT)?$"
# - provider: script
# skip_cleanup: true
# script: /bin/bash .travis/deploy_develop_to_openshift.sh
# on:
# branch: develop
# - provider: script
# skip_cleanup: true
# script: /bin/bash .travis/upload_dockerhub.sh
# on:
# all_branches: true
# tags: true
# condition: "$TRAVIS_TAG =~ ^v([[:digit:]]+\\.)+[[:digit:]]+(-[[:digit:]]+)?(-SNAPSHOT)?$"
after_success:
- /bin/bash .travis/codecov_bash.sh
################ Custom build stages:
# Special test-skipping stage to build CLI, using maven-wrapper
build-cli: &build-cli
script:
# re-export JAVA_HOME
- source ~/.jdk_config
# Prepare everything, no settings.xml needed
- ./mvnw clean install -B -V -DskipTests
# Change security providers of JDK
- /bin/bash .travis/enable_bouncycastle_security.sh
# Build native image, no settings.xml needed
- ./mvnw -f datasafe-cli/pom.xml clean package -B -V -Pnative-image -DskipTests
# Perform basic testing
- echo 'Testing built CLI'
- ./datasafe-cli/src/test/bash/basic_functionality_test_fs.sh datasafe-cli/target/datasafe-cli
# Docker not available on MacOS, allow to pass
- ./datasafe-cli/src/test/bash/basic_functionality_test_minio.sh datasafe-cli/target/datasafe-cli
# CLI artifacts publishing:
deploy-cli: &deploy-cli
deploy:
on:
branch: develop
provider: s3
access_key_id: ${AWS_ACCESS_KEY_ID}
secret_access_key: ${AWS_SECRET_ACCESS_KEY}
bucket: ${AWS_BUCKET}
region: ${AWS_REGION}
skip_cleanup: true
local_dir: datasafe-cli/target
upload-dir: datasafe-cli/${TRAVIS_OS_NAME}/${TRAVIS_COMMIT}
################ Build matrix:
# Build configuration definition:
matrix:
include:
#### PRIMARY BUILD ####
# This is original build and deploy script, that runs E2E tests and deploys docker images
- os: linux
language: java
jdk: openjdk8
#### CLI-ORIENTED BUILD ####
# These are CLI-only builds that produce Datasafe cli executable for each OS:
### CLI for Linux:
- os: linux
language: bash
before_install:
- source .travis/drop_deploy_secrets.sh
- /bin/bash .travis/install_custom_jdk_and_add_security_providers.sh
install:
- echo 'Nothing to do' # Override primary build logic
<<: *build-cli
<<: *deploy-cli
after_success:
- echo 'Nothing to do' # Override primary build logic
### CLI for MacOS:
- os: osx
language: bash
before_install:
- source .travis/drop_deploy_secrets.sh
- /bin/bash .travis/install_custom_jdk_and_add_security_providers.sh
install:
- echo 'Nothing to do' # Override primary build logic
<<: *build-cli
<<: *deploy-cli
after_success:
- echo 'Nothing to do' # Override primary build logic
# No WINDOWS here because it is in beta status yet.
cache:
directories:
- $HOME/.m2