This repository has been archived by the owner on Jul 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
.travis.yml
97 lines (93 loc) · 5.26 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
before_install:
- set -ex;
# trusty: gpg (GnuPG) 2.0.22, OpenSSL 1.0.1f 6 Jan 2014
# xenial: gpg (GnuPG) 2.1.11, OpenSSL 1.0.2g 1 Mar 2016
#- sudo apt -q -y install gnupg;
- sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe restricted multiverse";
sudo apt -q -y install aria2 gnupg2 graphviz openjdk-8-jdk openssl rsync sshpass whois;
#- whois $(curl ipinfo.io/ip);
# More options -> Settings -> Environment variables -> Add
# CI_OPT_GPG_PASSPHRASE
# CI_OPT_ORIGIN_REPO_SLUG
# CI_OPT_OSSRH_DOCKER_REGISTRY_PASS
# CI_OPT_OSSRH_DOCKER_REGISTRY_USER
# CI_OPT_OSSRH_GIT_AUTH_TOKEN
# CI_OPT_OSSRH_MVNSITE_PASSWORD
# CI_OPT_OSSRH_MVNSITE_USERNAME
# CI_OPT_OSSRH_NEXUS2_PASS
# CI_OPT_OSSRH_NEXUS2_USER
# CI_OPT_OSSRH_SONAR_LOGIN
- if [[ -d /usr/lib/jvm/java-8-openjdk-amd64 ]]; then sudo ln -s /usr/lib/jvm/java-8-openjdk-amd64 /usr/lib/jvm/java-8-openjdk; fi;
if [[ -d /usr/lib/jvm/java-11-openjdk-amd64 ]]; then sudo ln -s /usr/lib/jvm/java-11-openjdk-amd64 /usr/lib/jvm/java-11-openjdk; fi;
ls -ahl /usr/lib/jvm/;
- curl -sSL https://github.com/sormuras/bach/raw/master/install-jdk.sh | bash -s -- -F 11 --target $HOME/openjdk11 --workspace $HOME/.cache/install-jdk;
if [[ -d $HOME/openjdk11 ]]; then sudo ln -s $HOME/openjdk11 /usr/lib/jvm/java-11-openjdk; fi;
- if [[ -d /usr/lib/jvm/java-8-openjdk ]]; then export JAVA_HOME="/usr/lib/jvm/java-8-openjdk"; fi;
- export CI_OPT_MVN_MULTI_STAGE_BUILD="false";
source circ.sh;
#- export CI_OPT_CI_SCRIPT="${CI_OPT_GIT_PREFIX}/${TRAVIS_REPO_SLUG:-ci-and-cd/maven-build}/raw/${TRAVIS_BRANCH:-develop}/src/main/ci-script/lib_ci.sh";
#- echo "download ${SETTINGS_GLOBAL_XML_URL} to ${SETTINGS_GLOBAL_XML}";
# mkdir -p $(dirname ${SETTINGS_GLOBAL_XML});
# curl -L "${SETTINGS_GLOBAL_XML_URL}" 2>/dev/null | tee ${SETTINGS_GLOBAL_XML};
# export MAVEN_GLOBAL_SETTINGS="--global-settings ${SETTINGS_GLOBAL_XML}";
- if [[ -z "${MAVEN_OPTS}" ]]; then export MAVEN_OPTS="-XX:+UseParallelGC -Dmaven.repo.local=.m2/repository -Dprofile=title -DprofileFormat=JSON,HTML"; fi;
if [[ -d ${HOME}/.m2 ]]; then rm -rf ${HOME}/.m2/repository/top/infra/maven; ls -ahl ${HOME}/.m2; fi;
export MAVEN_USER_HOME="${PWD}/.m2";
./mvnw ${MAVEN_GLOBAL_SETTINGS} -version;
#- aria2c --file-allocation=none -c -x 10 -s 10 -m 0 --console-log-level=notice --log-level=notice --summary-interval=0 -o apache-maven-3.6.1-bin.zip https://archive.apache.org/dist/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.zip && unzip -qq apache-maven-3.6.1-bin.zip;
# export M2_HOME="$PWD/apache-maven-3.6.1";
# export PATH="$M2_HOME/bin:$PATH";
## see: https://github.com/travis-ci/travis.rb
#- if [[ "${CLEAN_TRAVIS_LOGS}" == "true" ]]; then
# ruby -v; gem install travis -v 1.8.10 --no-rdoc --no-ri; travis version;
# travis login --github-token ${CI_OPT_OSSRH_GIT_AUTH_TOKEN} --org;
# LAST_BUILD_NUMBER=$(print '\n' | travis history --limit 10 --org | head -n1 | cut -d" " -f1 | cut -c2-);
# echo "LAST_BUILD_NUMBER [${LAST_BUILD_NUMBER}]";
# for bn in $(seq 1 ${LAST_BUILD_NUMBER} ); do print '\n' | travis logs ${bn} --delete --force --org; done;
# fi;
branches:
only:
#- master # do nothing on master branch
- develop # snapshots on develop branch
- /^feature\/.*$/ # build and test on feature branches
- /^hotfix\/.*$/ # release on hotfix branches
- /^release\/.*$/ # release on release branches
- /^support\/.*$/ # release on support branches
#- /^v\d+\.\d+(\.\d+)?(-\S*)?/ # build and publish a github release (can skip tests here) or do nothing on version tags
cache:
directories:
- "$HOME/.cache"
- "$HOME/.gradle"
- "$HOME/.m2/repository"
- "$HOME/.m2/wrapper"
- "$HOME/.sonar/cache"
dist: bionic
env:
global:
- MAVEN_SKIP_RC=true
#group: edge
install: true
#jdk:
# - openjdk8
# - openjdk11
# - oraclejdk9
language: java
#language: ruby
#rvm:
# - 2.0
script:
# When prefixed with `travis_wait 30`, no log output until it is done.
# see: https://github.com/travis-ci/travis-ci/issues/4190 or https://github.com/HaxeFoundation/hxcpp/issues/709
- while sleep 9m; do echo "=====[ $SECONDS seconds still running ]====="; done &
- if [[ "${TRAVIS_ENABLED}" == "true" ]]; then
time CI_OPT_SONAR="true" ./mvnw ${MAVEN_GLOBAL_SETTINGS} -e -ntp -U clean deploy;
if type -p column > /dev/null; then find .mvn/profiler-report -name "*.json" | xargs cat | jq -r '.projects[]|"module:", .project, "plugins", (.mojos[]|[.mojo,.time]|@tsv)' | column -t; fi; rm -rf .mvn/profiler-report;
time CI_OPT_FAST="true" CI_OPT_INFRASTRUCTURE="custom" CI_OPT_MVN_MULTI_STAGE_BUILD="true" CI_OPT_NEXUS2_STAGING="false" ./mvnw ${MAVEN_GLOBAL_SETTINGS} -e -ntp deploy;
if type -p column > /dev/null; then find .mvn/profiler-report -name "*.json" | xargs cat | jq -r '.projects[]|"module:", .project, "plugins", (.mojos[]|[.mojo,.time]|@tsv)' | column -t; fi; rm -rf .mvn/profiler-report;
time ./mvnw ${MAVEN_GLOBAL_SETTINGS} -e -ntp site-deploy;
if type -p column > /dev/null; then find .mvn/profiler-report -name "*.json" | xargs cat | jq -r '.projects[]|"module:", .project, "plugins", (.mojos[]|[.mojo,.time]|@tsv)' | column -t; fi; rm -rf .mvn/profiler-report;
fi
- kill %1
services:
- docker
sudo: required