source: subversion/applications/editors/josm/plugins/mapillary/.travis.yml @ 32336

Last change on this file since 32336 was 32336, checked in by floscher, 4 years ago

Improve publishing of developer resources

  • use the credential store instead of suppressing the output of git push
  • print a message when nothing is published with information on why that's the case
  • now OpenJDK 8 is used instead of OracleJDK 8 for publishing
File size: 1.8 KB
Line 
1sudo: required
2dist: trusty
3group: edge
4
5language: java
6cache:
7  directories: $HOME/.gradle
8jdk:
9  - oraclejdk9
10  - oraclejdk8
11  - openjdk8
12before_install: pip install --user codecov
13before_script: # init GUI for tests that can't run headless
14  - "export DISPLAY=:99.0"
15  - "sh -e /etc/init.d/xvfb start"
16  - sleep 3
17script: ./gradlew build javadoc
18
19# Release the plugin via GitHub releases when pushing a tag
20before_deploy: 'cp -T build/libs/josm-mapillary-plugin.jar build/libs/Mapillary.jar'
21deploy:
22  provider: releases
23  api_key: "${GH_TOKEN}"
24  file: "build/libs/Mapillary.jar"
25  skip_cleanup: true
26  on:
27    tags: true
28
29# Deploy to GitHub pages
30after_script: |
31  if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_JDK_VERSION" == "openjdk8" ]; then
32    git config --global user.email "deploy@travis"
33    git config --global user.name "Travis CI"
34
35    # Prevent printout of credentials
36    git config --global credential.helper store
37    echo "https://${GH_USERNAME}:${GH_TOKEN}@github.com" > $HOME/.git-credentials
38
39    git remote add deploy "https://github.com/floscher/josm-mapillary-plugin.git"
40    git fetch --depth=1 origin gh-pages:gh-pages
41    git checkout gh-pages
42    git rm -r reports/ docs/
43    mkdir -p reports/ docs/
44    cp -R build/docs/javadoc/ docs/javadoc/
45    cp -R build/reports/tests/ reports/junit/
46    cp -R build/reports/jacoco/ reports/jacoco/
47    cp -R build/reports/findbugs/ reports/findbugs/
48    git stage docs/ reports/
49    masterCommit=`git rev-parse master`
50    git commit -m "Publish developer resources to GitHub pages
51
52  These resources are generated by Travis CI for commit $masterCommit using Gradle."
53    git push deploy gh-pages
54  else
55    echo "This is branch $TRAVIS_BRANCH with JDK $TRAVIS_JDK_VERSION, developer resources are only published with openjdk8 on branch master."
56  fi
57
58after_success: codecov
Note: See TracBrowser for help on using the repository browser.