forked from opentripplanner/OpenTripPlanner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
65 lines (57 loc) · 3.22 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
language: java
jdk:
- openjdk8
# Replace Travis's default Maven installation step with a no-op.
# This avoids redundantly pre-running 'mvn install -DskipTests' every time.
install: true
# Replace Travis's default build step.
# Run all Maven phases at once up through verify, install, and deploy.
script: |
# only (attempt to) deploy non-pull request commits to the master branch or to tags
if [[ "$TRAVIS_PULL_REQUEST" = false ]] && [[ "$TRAVIS_BRANCH" = master || ! -z "$TRAVIS_TAG" ]]; then
mvn clean deploy --settings maven-settings.xml
else
# otherwise, just run test suite
mvn clean verify --settings maven-settings.xml -B -V -Dgpg.skip
fi
# Secure envs are OSSRH_JIRA_USERNAME, OSSRH_JIRA_PASSWORD, GPG_KEY_NAME, GPG_PASSPHRASE
env:
global:
- JAVA_OPTS=-Xmx2g
- secure: SR50xh5n9H9ML20NM9QK3Y7rS1xzmMgLtp8Hke7fPL4QsCvdd1CTXTIjGPtCNzvEx0zUKIx1vO0s5mwnB0KyhTzwI8t5xvw7RErp7v7WiskKVKVkCu6EPDsTH1d3iQpF4QAFy/07HehCvGtObh3XnOYZKRfoxpY3/n9y/DxuKp8=
- secure: R8kd55l4UXde9pa6POKFFFmkp4N7KD03vCAiT5dEOvDDKBRIGo1n7Yn+txIhpe8VJVYDqAxOUdW9yZO29GWvjNTiFmDqbvC4GuzWqU+Am1Dfmi5Udmmswcy4CTeoNqKchhNn69EhphdFsKE+JzCZIJSo4+Gl0jAqxMBE13ghlBw=
- secure: LV+MX/r5l/ycNS1fQNxdzBLyGLnAsG8G3APWsvqb0Sou/fPncwjfGV178jxPUULhb8VAex+MIJsBObrQGD4vdvqBI9ASPHReplANLYrsAAzTm0bPkkyQCs37cDq9ORsETnR9j8m8G/0+8bxH81WOOEv56h4fiQog5z3cBbSGdh0=
- secure: cAXIX+Op0EXl3GHX5qCOGHrFQpPlvVSq8mh5zqABSICsMQHUgTyOgSNUykOdrOarjM2y2H1+Yu2MfLtu2v1hAS/zSzAswx+7T7xwptsX1bd+QX2s9+3q4OgG/97Il3Dqhbf9mGqxJyfWP4iD1Ry9IIlsIGk/coe877mkZCbKb2s=
# If sudo is disabled, CI runs on container based infrastructure (allows caching &c.)
sudo: false
# Retain the local Maven repository to speed up builds.
cache:
directories:
- $HOME/.m2/repository
# Notify us of the build status on the Slack channel
notifications:
slack: conveyal:RQuTZBfE7FBjVtYkKwdnNRjY
# Decrypt and import the artifact signing certificate before running the build
before_install:
- if [[ "$TRAVIS_PULL_REQUEST" = "false" ]]; then openssl aes-256-cbc -K $encrypted_9918733fe303_key -iv $encrypted_9918733fe303_iv -in maven-artifact-signing-key.asc.enc -out maven-artifact-signing-key.asc -d && gpg --import --batch maven-artifact-signing-key.asc; fi
before_deploy:
# Get branch name of current branch for use in jar name: https://graysonkoonce.com/getting-the-current-branch-name-during-a-pull-request-in-travis-ci/
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
# Copy shaded jar over to deploy dir as git-described jar (either version or version+commit) and branch-specific jar.
- mkdir deploy
- cp target/*-shaded.jar deploy/otp-$(git describe --always).jar
- cp target/*-shaded.jar deploy/otp-latest-$BRANCH.jar
deploy:
provider: s3
skip_cleanup: true
# AWS CI user: opentripplanner-ci
access_key_id: AKIAJEQQINNZK2IDHMJQ
secret_access_key:
secure: CCRXXGZ0RXSUQaVKHFlZjleEygesT3ec/rHUf28l7lw1XxOZBZulONqydL45OIQUM26JYge2SK+rMJfcN38qPVHXVbYQgGdcKnCQN76Kxj3MoNbMXrrvaKPZZq6jP0TOTHUTIh4TGO5Bu5nM6fV7zcySCFchC6yMF9EC90jDDns=
# Upload jars found in local directory to s3 bucket
local-dir: deploy
bucket: opentripplanner-builds
acl: public_read
on:
repo: opentripplanner/OpenTripPlanner
all_branches: true