|
| 1 | +dist: trusty # jdk 8 not available on xenial |
1 | 2 | language: java
|
2 |
| -jdk: |
3 |
| -- oraclejdk8 |
| 3 | +java: |
| 4 | + - oraclejdk8 |
4 | 5 | install: true
|
5 | 6 | sudo: false
|
6 | 7 | # Install mongoDB to perform persistence tests
|
7 |
| -services: mongodb |
| 8 | +services: |
| 9 | + - mongodb |
| 10 | + - postgresql |
| 11 | +addons: |
| 12 | + postgresql: 9.6 |
8 | 13 | cache:
|
9 | 14 | directories:
|
10 |
| - - "$HOME/.m2" |
| 15 | + - $HOME/.m2 |
| 16 | + - $HOME/.cache/yarn |
| 17 | +# Install semantic-release |
| 18 | +before_script: |
| 19 | + - yarn global add @conveyal/maven-semantic-release semantic-release@15 |
| 20 | + # Create dir for GTFS+ files (used during testing) |
| 21 | + - mkdir /tmp/gtfsplus |
11 | 22 | before_install:
|
12 | 23 | #- sed -i.bak -e 's|https://nexus.codehaus.org/snapshots/|https://oss.sonatype.org/content/repositories/codehaus-snapshots/|g' ~/.m2/settings.xml
|
13 | 24 | # set region in AWS config for S3 setup
|
14 | 25 | - mkdir ~/.aws && printf '%s\n' '[default]' 'aws_access_key_id=foo' 'aws_secret_access_key=bar' 'region=us-east-1' > ~/.aws/config
|
15 | 26 | - cp configurations/default/server.yml.tmp configurations/default/server.yml
|
| 27 | +# create database for tests |
| 28 | +- psql -U postgres -c 'CREATE DATABASE catalogue;' |
16 | 29 | script:
|
17 | 30 | # package jar
|
18 | 31 | - mvn package
|
19 | 32 | after_success:
|
20 |
| -# Upload coverage reports to codecov.io |
21 |
| -- bash <(curl -s https://codecov.io/bash) |
22 |
| -# notify slack channel of build status |
| 33 | + # this first codecov run will upload a report associated with the commit set through Travis CI environment variables |
| 34 | + - bash <(curl -s https://codecov.io/bash) |
| 35 | + # run maven-semantic-release to potentially create a new release of datatools-server. The flag --skip-maven-deploy is |
| 36 | + # used to avoid deploying to maven central. So essentially, this just creates a release with a changelog on github. |
| 37 | + # |
| 38 | + # If maven-semantic-release finishes successfully and the current branch is master, upload coverage reports for the |
| 39 | + # commits that maven-semantic-release generated. Since the above codecov run is associated with the commit that |
| 40 | + # initiated the Travis build, the report will not be associated with the commits that maven-semantic-release performed |
| 41 | + # (if it ended up creating a release and the two commits that were a part of that workflow). Therefore, if on master |
| 42 | + # codecov needs to be ran two more times to create codecov reports for the commits made by maven-semantic-release. |
| 43 | + # See https://github.com/conveyal/gtfs-lib/issues/193. |
| 44 | + # |
| 45 | + # The git commands get the commit hash of the HEAD commit and the commit just before HEAD. |
| 46 | + - | |
| 47 | + semantic-release --prepare @conveyal/maven-semantic-release --publish @semantic-release/github,@conveyal/maven-semantic-release --verify-conditions @semantic-release/github,@conveyal/maven-semantic-release --verify-release @conveyal/maven-semantic-release --use-conveyal-workflow --dev-branch=dev --skip-maven-deploy |
| 48 | + if [[ "$TRAVIS_BRANCH" = "master" ]]; then |
| 49 | + bash <(curl -s https://codecov.io/bash) -C "$(git rev-parse HEAD)" |
| 50 | + bash <(curl -s https://codecov.io/bash) -C "$(git rev-parse HEAD^)" |
| 51 | + fi |
23 | 52 | notifications:
|
| 53 | + # notify slack channel of build status |
24 | 54 | slack: conveyal:WQxmWiu8PdmujwLw4ziW72Gc
|
25 | 55 | before_deploy:
|
26 | 56 | # 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/
|
27 | 57 | - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
|
28 |
| -# copy packaged jars over to deploy dir |
| 58 | +# Create directory that will contain artifacts to deploy to s3. |
29 | 59 | - mkdir deploy
|
| 60 | +# Display contents of target directory (for logging purposes only). |
| 61 | +- ls target/*.jar |
| 62 | +# Copy packaged jars over to deploy dir. |
30 | 63 | - cp target/dt-*.jar deploy/
|
31 |
| -- cp "target/dt-$(git describe --always).jar" "deploy/dt-latest-${BRANCH}.jar" |
| 64 | +# FIXME: Do not create a branch-specific jar for now. Having a jar that changes contents but keeps the same name |
| 65 | +# may cause confusion down the road and may be undesirable. |
| 66 | +# - cp "target/dt-$(git describe --always).jar" "deploy/dt-latest-${BRANCH}.jar" |
32 | 67 | deploy:
|
33 | 68 | provider: s3
|
34 | 69 | skip_cleanup: true
|
35 |
| - access_key_id: AKIAJISY76KTZBNHS4SA |
| 70 | + access_key_id: AKIAIWMAQP5YXWT7OZEA |
36 | 71 | secret_access_key:
|
37 |
| - secure: a2PNYiv7kzgKxfSx6IhZxSCFBZTCjrbIAK/vmCB1KcpnlV4vTt/IL13i3u6XC8wAbUxhd6iJMtVRm4diIwmy0K7nnpp0h3cQDxYqWCmf1dHZWBJXkpurDpbfxW5G6IlL14i+EsTSCpmwalov+atOBDVyJWVGqfEYaj9c6Q1E0fiYNP3QwZQcsVuD1CRw91xzckfERwqYcz70p/hmTEPOgUwDHuyHsjFafJx+krY3mnBdRdDRLcnPavjcEtprjGkdiVbNETe3CHVNQrAVfqm187OoDA2tHTPjTFmlAdUedp4rYqLmF/WWbHZLzUkQb95FJkklx30vlwC0bIutP1TwIlr3ma5aCRFc58x3SzG07AeM+vbt/nh5A52cpdRjBnhctC2kL++QvwkJhwRy2xptl/WEd5AUagoN4ngnGzyDS4kk/taQFL0IAav5C2WH668kGyH17KNeWG/bCDd55oCvwNlppAYXH+WdbtylqiVb9Fllvs1wcIYWqqyX5zdYiyFEI8LyEQsNF/D5ekuAtLXcF25uwjNtHMjdAxQxHbAbBOeaaLwJd29os9GrKFI/2C0TVXZo2zaFLZyFaIsDHqAC+MXDBDtktimC9Uuozz7bXENCrOUBfsDEQXb46tkXLGaQNXeOhe3KwVKxlGDCsLb7iHIcdDyBm19hqUWhU3uA+dU= |
| 72 | + secure: cDfIv+/+YimqsH8NvWQZy9YTqaplOwlIeEK+KEBCfsJ3DJK5sa6U4BMZCA4OMP1oTEaIxkd4Rcvj0OAYSFQVNQHtwc+1WeHobzu+MWajMNwmJYdjIvCqMFg2lgJdzCWv6vWcitNvrsYpuXxJlQOirY/4GjEh2gueHlilEdJEItBGYebQL0/5lg9704oeO9v+tIEVivtNc76K5DoxbAa1nW5wCYD7yMQ/cc9EQiMgR5PXNEVJS4hO7dfdDwk2ulGfpwTDrcSaR9JsHyoXj72kJHC9wocS9PLeeYzNAw6ctIymNIjotUf/QUeMlheBbLfTq6DKQ0ISLcD9YYOwviUMEGmnte+HCvTPTtxNbjBWPGa2HMkKsGjTptWu1RtqRJTLy19EN1WG5znO9M+lNGBjLivxHZA/3w7jyfvEU3wvQlzo59ytNMwOEJ3zvSm6r3/QmOr5BU+UHsqy5vv2lOQ9Nv10Uag11zDP1YWCoD96jvjZJsUZtW80ZweHYpDMq0vKdZwZSlbrhgHzS7vlDW7llZPUntz0SfKCjtddbRdy6T4HgsmA8EsBATfisWpmFA6roQSnYwfEZ5ooJ8IMjfOm1qGphrP1Qv8kYkqdtOyTijYErqJ3YzldjeItqaWtyD5tmHm6Wmq6XIbw4bnSfGRx9di+cG5lDEPe1tfBPCf9O5M= |
38 | 73 | # upload jars in deploy dir to bucket
|
39 | 74 | bucket: datatools-builds
|
40 | 75 | local-dir: deploy
|
41 | 76 | acl: public_read
|
42 | 77 | on:
|
43 |
| - repo: catalogueglobal/datatools-server |
| 78 | + repo: ibi-group/datatools-server |
44 | 79 | all_branches: true
|
0 commit comments