Skip to content

Commit fa0f9b8

Browse files
Add stage for Centos 7
* Build the change on Centos 7 docker using the Dockerfile for the same.
1 parent be7dfcb commit fa0f9b8

File tree

1 file changed

+110
-0
lines changed

1 file changed

+110
-0
lines changed

dev-support/Jenkinsfile

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,116 @@ pipeline {
5757
}
5858
}
5959

60+
stage ('precommit-run (centos-7)') {
61+
steps {
62+
withCredentials(
63+
[usernamePassword(credentialsId: 'apache-hadoop-at-github.202132.xyz',
64+
passwordVariable: 'GITHUB_TOKEN',
65+
usernameVariable: 'GITHUB_USER'),
66+
usernamePassword(credentialsId: 'hadoopqa-at-asf-jira',
67+
passwordVariable: 'JIRA_PASSWORD',
68+
usernameVariable: 'JIRA_USER')]) {
69+
sh '''#!/usr/bin/env bash
70+
71+
set -e
72+
73+
TESTPATCHBIN="${WORKSPACE}/${YETUS}/precommit/src/main/shell/test-patch.sh"
74+
75+
# this must be clean for every run
76+
if [[ -d "${WORKSPACE}/${PATCHDIR}" ]]; then
77+
rm -rf "${WORKSPACE}/${PATCHDIR}"
78+
fi
79+
mkdir -p "${WORKSPACE}/${PATCHDIR}"
80+
81+
# if given a JIRA issue, process it. If CHANGE_URL is set
82+
# (e.g., Github Branch Source plugin), process it.
83+
# otherwise exit, because we don't want Hadoop to do a
84+
# full build. We wouldn't normally do this check for smaller
85+
# projects. :)
86+
if [[ -n "${JIRA_ISSUE_KEY}" ]]; then
87+
YETUS_ARGS+=("${JIRA_ISSUE_KEY}")
88+
elif [[ -z "${CHANGE_URL}" ]]; then
89+
echo "Full build skipped" > "${WORKSPACE}/${PATCHDIR}/report.html"
90+
exit 0
91+
fi
92+
93+
YETUS_ARGS+=("--patch-dir=${WORKSPACE}/${PATCHDIR}")
94+
95+
# where the source is located
96+
YETUS_ARGS+=("--basedir=${WORKSPACE}/${SOURCEDIR}")
97+
98+
# our project defaults come from a personality file
99+
YETUS_ARGS+=("--project=hadoop")
100+
YETUS_ARGS+=("--personality=${WORKSPACE}/${SOURCEDIR}/dev-support/bin/hadoop.sh")
101+
102+
# lots of different output formats
103+
YETUS_ARGS+=("--brief-report-file=${WORKSPACE}/${PATCHDIR}/brief.txt")
104+
YETUS_ARGS+=("--console-report-file=${WORKSPACE}/${PATCHDIR}/console.txt")
105+
YETUS_ARGS+=("--html-report-file=${WORKSPACE}/${PATCHDIR}/report.html")
106+
107+
# enable writing back to Github
108+
YETUS_ARGS+=(--github-token="${GITHUB_TOKEN}")
109+
110+
# enable writing back to ASF JIRA
111+
YETUS_ARGS+=(--jira-password="${JIRA_PASSWORD}")
112+
YETUS_ARGS+=(--jira-user="${JIRA_USER}")
113+
114+
# auto-kill any surefire stragglers during unit test runs
115+
YETUS_ARGS+=("--reapermode=kill")
116+
117+
# set relatively high limits for ASF machines
118+
# changing these to higher values may cause problems
119+
# with other jobs on systemd-enabled machines
120+
YETUS_ARGS+=("--proclimit=5500")
121+
YETUS_ARGS+=("--dockermemlimit=22g")
122+
123+
# -1 spotbugs issues that show up prior to the patch being applied
124+
YETUS_ARGS+=("--spotbugs-strict-precheck")
125+
126+
# rsync these files back into the archive dir
127+
YETUS_ARGS+=("--archive-list=checkstyle-errors.xml,spotbugsXml.xml")
128+
129+
# URL for user-side presentation in reports and such to our artifacts
130+
# (needs to match the archive bits below)
131+
YETUS_ARGS+=("--build-url-artifacts=artifact/out")
132+
133+
# plugins to enable
134+
YETUS_ARGS+=("--plugins=all")
135+
136+
# don't let these tests cause -1s because we aren't really paying that
137+
# much attention to them
138+
YETUS_ARGS+=("--tests-filter=checkstyle")
139+
140+
# run in docker mode and specifically point to our
141+
# Dockerfile since we don't want to use the auto-pulled version.
142+
YETUS_ARGS+=("--docker")
143+
YETUS_ARGS+=("--dockerfile=${SOURCEDIR}/dev-support/docker/Dockerfile_centos_7")
144+
YETUS_ARGS+=("--mvn-custom-repos")
145+
146+
# effectively treat dev-suport as a custom maven module
147+
YETUS_ARGS+=("--skip-dirs=dev-support")
148+
149+
# help keep the ASF boxes clean
150+
YETUS_ARGS+=("--sentinel")
151+
152+
# test with Java 8 and 11
153+
YETUS_ARGS+=("--java-home=/usr/lib/jvm/java-8-openjdk-amd64")
154+
YETUS_ARGS+=("--multijdkdirs=/usr/lib/jvm/java-11-openjdk-amd64")
155+
YETUS_ARGS+=("--multijdktests=compile")
156+
157+
# custom javadoc goals
158+
YETUS_ARGS+=("--mvn-javadoc-goals=process-sources,javadoc:javadoc-no-fork")
159+
160+
# write Yetus report as GitHub comment (YETUS-1102)
161+
YETUS_ARGS+=("--github-write-comment")
162+
YETUS_ARGS+=("--github-use-emoji-vote")
163+
164+
"${TESTPATCHBIN}" "${YETUS_ARGS[@]}"
165+
'''
166+
}
167+
}
168+
}
169+
60170
stage ('precommit-run') {
61171
steps {
62172
withCredentials(

0 commit comments

Comments
 (0)