forked from apache/nifi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
126 lines (119 loc) · 6.62 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
language: java
matrix:
include:
- stage: "Cache"
name: "Cache Dependencies - no explicit jdk specified"
script: >-
if [ ! -d "$HOME"/.m2/repository ] || [ ! "$(ls -A "$HOME"/.m2/repository)" ] ; then
echo "Cached Maven repository does not exist, downloading dependencies..."
mvn -V -T 1C -pl !./nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-nar,!./nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors dependency:go-offline -Dsilent -ntp --fail-never \
| grep -v -F -f .travis-output-filters -e "Failed to execute goal on project"
else
echo "Cached Maven repository exists, skipping dependency cache"
fi
- stage: "Cache"
name: "Cache Dependencies - openjdk8"
jdk: openjdk8
script: >-
if [ ! -d "$HOME"/.m2/repository ] || [ ! "$(ls -A "$HOME"/.m2/repository)" ] ; then
echo "Cached Maven repository does not exist, downloading dependencies..."
mvn -V -T 1C -pl !./nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-nar,!./nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors dependency:go-offline -Dsilent -ntp --fail-never \
| grep -v -F -f .travis-output-filters -e "Failed to execute goal on project"
else
echo "Cached Maven repository exists, skipping dependency cache"
fi
# For the build stages, use -pl to exclude the following from the build to reduce build time:
# non-api nar modules
# assembly modules
# nifi-maven-archetype directories that have "__" in the name
- stage: "Build"
name: "Build Java 8 EN"
jdk: openjdk8
script: >-
mvn clean install -V -T 1C
-pl `find . -type d \( -name "*-nar" -or -name "*-assembly" -or -name "*hive3*" -or -name "nifi-system-test*" \) -and -not -name "*api-nar" -and -not -path "*/target/*" -and -not -name "*__*" -printf "!./%P,"`
-Pcontrib-check,include-grpc -Ddir-only
-Dmaven.surefire.arguments="-Duser.language=en -Duser.region=US"
| grep -v -F -f .travis-output-filters
&& test ${PIPESTATUS[0]} -eq 0
- stage: "Build"
name: "Build Java 8 FR"
jdk: openjdk8
script: >-
mvn clean install -V -T 1C
-pl `find . -type d \( -name "*-nar" -or -name "*-assembly" -or -name "*hive3*" -or -name "nifi-system-test*" \) -and -not -name "*api-nar" -and -not -path "*/target/*" -and -not -name "*__*" -printf "!./%P,"`
-Pcontrib-check,include-grpc -Ddir-only
-Dmaven.surefire.arguments="-Duser.language=fr -Duser.region=FR"
| grep -v -F -f .travis-output-filters
&& test ${PIPESTATUS[0]} -eq 0
- stage: "Build"
name: "Build Java 8 JA"
jdk: openjdk8
script: >-
mvn clean install -V -T 1C
-pl `find . -type d \( -name "*-nar" -or -name "*-assembly" -or -name "*hive3*" -or -name "nifi-system-test*" \) -and -not -name "*api-nar" -and -not -path "*/target/*" -and -not -name "*__*" -printf "!./%P,"`
-Pcontrib-check,include-grpc -Ddir-only
-Dmaven.surefire.arguments="-Duser.language=ja -Duser.region=JP"
| grep -v -F -f .travis-output-filters
&& test ${PIPESTATUS[0]} -eq 0
- stage: "Build"
name: "Build Java 11 EN"
# Do not specify "jdk:" here, install-jdk.sh will download the JDK set JAVA_HOME appropriately
before_script:
# Download the newest version of sormuras' install-jdk.sh to /tmp
# install-jdk.sh is used by Travis internally, sormoras is the maintainer of that script
- wget -O /tmp/install-jdk.sh https://github.com/sormuras/bach/raw/master/install-jdk.sh
# Need to specifically install AdoptOpenJDK 11.0.4 (Linux, HotSpot) since Travis does not offer it by default
# The link to the AdoptOpenJDK 11.0.4 .tar.gz is taken directly from AdoptOpenJDK's website
- >-
source /tmp/install-jdk.sh
--url 'https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.4%2B11/OpenJDK11U-jdk_x64_linux_hotspot_11.0.4_11.tar.gz'
script:
- >-
mvn clean install -V -T 1C
-pl `find . -type d \( -name "*-nar" -or -name "*-assembly" -or -name "*hive3*" -or -name "nifi-system-test*" \) -and -not -name "*api-nar" -and -not -path "*/target/*" -and -not -name "*__*" -printf "!./%P,"`
-Pcontrib-check,include-grpc -Ddir-only
-Dmaven.surefire.arguments="-Duser.language=en -Duser.region=US"
| grep -v -F -f .travis-output-filters
&& test ${PIPESTATUS[0]} -eq 0
os:
- linux
# Caches mvn repository in order to speed up builds
cache:
directories:
- $HOME/.m2
- $HOME/.npm
before_cache:
# Remove nifi repo again to save travis from caching it
- rm -rf $HOME/.m2/repository/org/apache/nifi/
# before_install aids in a couple workarounds for issues within the Travis-CI environment
# 1. Workaround for buffer overflow issues with OpenJDK versions of java as per https://github.com/travis-ci/travis-ci/issues/5227#issuecomment-165135711
# 2. Workaround for non-existent Maven repository as per: https://github.com/travis-ci/travis-ci/issues/4629#issuecomment-131214465
before_install:
- sudo hostname "$(hostname | cut -c1-63)"
- sed -e "s/^\\(127\\.0\\.0\\.1.*\\)/\\1 $(hostname | cut -c1-63)/" /etc/hosts | sudo tee /etc/hosts
- sed -i.bak -e 's|https://nexus.codehaus.org/snapshots/|https://oss.sonatype.org/content/repositories/codehaus-snapshots/|g' ~/.m2/settings.xml
- echo "MAVEN_OPTS='-Xmx2g -XX:+UseG1GC'" > ~/.mavenrc
- cat ~/.mavenrc
# Remove nifi repo again to save travis from caching it
- rm -rf $HOME/.m2/repository/org/apache/nifi/
# Install Maven 3.6.1
- wget -O /tmp/apache-maven-3.6.1-bin.tar.gz https://archive.apache.org/dist/maven/maven-3/3.6.1/binaries/apache-maven-3.6.1-bin.tar.gz
- tar xzf /tmp/apache-maven-3.6.1-bin.tar.gz -C /tmp
- export M2_HOME=/tmp/apache-maven-3.6.1
- export PATH=$M2_HOME/bin:$PATH
install: true