This repository has been archived by the owner on Jul 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
40 lines (40 loc) · 2.59 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
dist: trusty
language: java
jdk:
- oraclejdk8
- oraclejdk9
- openjdk8
#- oraclejdk11
- openjdk10
- openjdk11
services:
- docker
jobs:
include:
- stage: Coverage
jdk: oraclejdk8
script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
- chmod +x ./cc-test-reporter
- ./cc-test-reporter before-build
- mvn clean package
- JACOCO_SOURCE_PATH=src/main/java ./cc-test-reporter format-coverage target/site/jacoco/jacoco.xml --input-type jacoco
- ./cc-test-reporter upload-coverage
- stage: Tag Release
if: type = push AND branch = master AND commit_message !~ /^Travis bot released/
install: skip
script: git checkout master && git reset --hard $sha1 && git config --global push.followTags true && git config --global user.email "travis@travis-ci.org" && git config --global user.name "Travis CI" && export current_version=$(mvn -q -Dexec.executable="echo" -Dexec.args='${project.version}' --non-recursive exec:exec) && echo "current version ${current_version}" && export minor=$(echo $current_version | sed "s/^[0-9]\{1,\}\.[0-9]\{1,\}\.\([0-9]\{1,\}\)/\1/") && export major=$(echo $current_version | sed "s/^\([0-9]\{1,\}\.[0-9]\{1,\}\)\.[0-9]\{1,\}/\1/") && export next_version=$major.$((minor+1)) && echo "next version ${next_version}" && sed -i.bak "s/$current_version/$next_version/g" README.md && rm README.md.bak && sed -i.bak "s/^ <version>$current_version<\\/version>/ <version>$next_version<\\/version>/g" pom.xml && rm pom.xml.bak && git status && git commit -am "Travis bot released $next_version" && git tag -a $next_version -m "Automated release" && git remote add target https://${GH_TOKEN}@github.com/groupdocs-viewer/GroupDocs.Viewer-for-Java-Spring.git > /dev/null 2>&1 && git remote -v && git push --set-upstream target master
- stage: Release
if: type = push AND branch = master AND commit_message =~ /^Travis bot released/
install: skip
jdk: oraclejdk8
script: mvn clean package && mkdir -p target/release/DocumentSamples && mkdir -p target/release/Licenses && cp target/viewer-spring-*.jar target/release && cp configuration.yml target/release && cd target && tar -zcvf release.tar.gz release && cd .. && echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin && docker build -t groupdocs/viewer . && docker push groupdocs/viewer
deploy:
provider: releases
overwrite: true
skip_cleanup: true
api_key: $GH_TOKEN
file: target/release.tar.gz
on:
repo: groupdocs-viewer/GroupDocs.Viewer-for-Java-Spring
branch: master