-
Notifications
You must be signed in to change notification settings - Fork 237
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revamp build/CI #1097
Revamp build/CI #1097
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,9 +34,19 @@ if (needSplittingFromWorkspace) { | |
|
||
branches['CI'] = { | ||
stage('CI') { | ||
node('maven-11') { | ||
checkout scm | ||
sh "mvn verify --no-transfer-progress -DskipTests -P jenkins-release" | ||
retry(count: 2, conditions: [kubernetesAgent(handleNonKubernetes: true), nonresumable()]) { | ||
node('maven-11') { | ||
checkout scm | ||
def mavenOptions = [ | ||
'-Dset.changelist', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needed for producing incrementals. |
||
'-DskipTests', | ||
'-U', | ||
'clean', | ||
'install', | ||
Comment on lines
+44
to
+45
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needed for |
||
] | ||
infra.runMaven(mavenOptions, 11) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Internally respects |
||
infra.prepareToPublishIncrementals() | ||
} | ||
} | ||
} | ||
} | ||
|
@@ -71,7 +81,7 @@ for (int i = 0; i < splits.size(); i++) { | |
set-java.sh $javaVersion | ||
eval \$(vnc.sh) | ||
java -version | ||
run.sh firefox ${jenkinsUnderTest} -Dmaven.test.failure.ignore=true -DforkCount=1 -B | ||
run.sh firefox ${jenkinsUnderTest} -Dmaven.repo.local=${WORKSPACE_TMP}/m2repo -Dmaven.test.failure.ignore=true -DforkCount=1 -B | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See jenkinsci/bom#1842. |
||
""" | ||
} | ||
} | ||
|
@@ -83,3 +93,4 @@ for (int i = 0; i < splits.size(); i++) { | |
} | ||
} | ||
parallel branches | ||
infra.maybePublishIncrementals() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,7 @@ | |
<trimStackTrace>false</trimStackTrace> <!-- surefire --> | ||
<spotbugs.skip>true</spotbugs.skip> | ||
|
||
<jenkins.version>2.399</jenkins.version> | ||
<selenium.version>4.8.1</selenium.version> | ||
<guava.version>31.1-jre</guava.version> <!-- aligned with selenium --> | ||
<aether.version>1.1.0</aether.version> | ||
|
@@ -362,6 +363,24 @@ | |
<version>1.12.14</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<!-- | ||
This is just for dependency updates. | ||
TODO: Delete this dependency and figure out how to automatically update | ||
this dependency some other way. | ||
--> | ||
<dependency> | ||
<groupId>org.jenkins-ci.main</groupId> | ||
<artifactId>jenkins-core</artifactId> | ||
<version>${jenkins.version}</version> | ||
<scope>test</scope> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>*</groupId> | ||
<artifactId>*</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
Comment on lines
+358
to
+375
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Copying the trick I did in |
||
<dependency> | ||
<groupId>org.mockito</groupId> | ||
<artifactId>mockito-core</artifactId> | ||
|
@@ -788,5 +807,48 @@ and | |
</plugins> | ||
</build> | ||
</profile> | ||
<profile> | ||
<id>download-war</id> | ||
<activation> | ||
<file> | ||
<missing>${env.JENKINS_WAR}</missing> | ||
</file> | ||
</activation> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<id>jenkins-war</id> | ||
<goals> | ||
<goal>copy</goal> | ||
</goals> | ||
<phase>process-test-resources</phase> | ||
<configuration> | ||
<artifactItems> | ||
<artifactItem> | ||
<groupId>org.jenkins-ci.main</groupId> | ||
<artifactId>jenkins-war</artifactId> | ||
<version>${jenkins.version}</version> | ||
<type>war</type> | ||
</artifactItem> | ||
</artifactItems> | ||
<outputDirectory>${project.build.directory}</outputDirectory> | ||
<stripVersion>true</stripVersion> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</profile> | ||
Comment on lines
+807
to
+843
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you are reading this PR from top to bottom, this hunk will only make sense after you have read the changes to |
||
<profile> | ||
<id>lts</id> | ||
<properties> | ||
<jenkins.version>2.387.1</jenkins.version> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will need to be updated by the release lead after shipping an LTS release, just like in BOM. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Filed #1098 for later improvement |
||
</properties> | ||
</profile> | ||
</profiles> | ||
</project> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,22 +7,30 @@ if [[ $# -lt 2 ]]; then | |
It can use jenkins.war from local maven repository or download it when missing. | ||
|
||
BROWSER: Value for BROWSER variable | ||
JENKINS: Path to the jenkins.war, Jenkins version of one of "latest", "latest-rc", "lts" and "lts-rc" | ||
JENKINS: Path to the Jenkins WAR, URL to the Jenkins WAR, version of the Jenkins WAR, "latest", or "lts" | ||
|
||
Examples: | ||
|
||
# Run full suite in FF against ./jenkins.war. | ||
# Run full suite in Firefox against a URL: | ||
$ ./run firefox https://updates.jenkins.io/download/war/2.394/jenkins.war | ||
|
||
# Run full suite in Firefox against ./jenkins.war: | ||
$ ./run firefox ./jenkins.war | ||
|
||
# Run Ant plugin test in chrome against Jenkins 1.512. | ||
$ ./run chrome 1.512 -Dtest=AntPluginTest | ||
# Run Ant plugin test in chrome against Jenkins 2.399: | ||
$ ./run chrome 2.399 -Dtest=AntPluginTest | ||
|
||
# Run full suite in FF against LTS release candidate | ||
$ ./run firefox lts-rc | ||
# Run full suite in Firefox against LTS: | ||
$ ./run firefox lts | ||
USAGE | ||
exit 2 | ||
fi | ||
|
||
MVN='mvn -V -e -ntp' | ||
if [[ -n ${MAVEN_SETTINGS-} ]]; then | ||
MVN="${MVN} -s ${MAVEN_SETTINGS}" | ||
fi | ||
Comment on lines
+29
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Observe |
||
|
||
function download() { | ||
echo "Fetching $1 to $2" | ||
status=$(curl --http1.1 -sSL --write-out '%{http_code}' --retry 3 --retry-delay 0 --retry-max-time 60 -o "$2" "$1") | ||
|
@@ -39,50 +47,33 @@ fi | |
|
||
browser=$1 | ||
war=$2 | ||
extra_args= | ||
|
||
if [[ ! -f $war ]]; then | ||
case "$war" in | ||
latest) | ||
war=jenkins-latest.war | ||
url=https://updates.jenkins.io/latest/jenkins.war | ||
# Maven will download this in the process-test-resources phase | ||
war=target/jenkins-war.war | ||
;; | ||
lts) | ||
war=jenkins-lts.war | ||
url=https://updates.jenkins.io/stable/latest/jenkins.war | ||
# Maven will download this in the process-test-resources phase | ||
war=target/jenkins-war.war | ||
extra_args='-Plts' | ||
;; | ||
*.war) | ||
download "$war" "jenkins.war" || exit 1 | ||
war=jenkins.war | ||
;; | ||
Comment on lines
+63
to
+66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Due to the |
||
*) | ||
# Maven will download this in the process-test-resources phase | ||
war=target/jenkins-war.war | ||
extra_args="-Djenkins.version=$2" | ||
;; | ||
esac | ||
|
||
if [[ -n $url ]]; then | ||
find $war -maxdepth 0 -mtime +1 -delete 2>/dev/null | ||
if [[ ! -f $war ]]; then | ||
download "$url" "$war" || exit 1 | ||
fi | ||
fi | ||
fi | ||
|
||
if [[ ! -f $war ]] && [[ $war == *.war ]]; then | ||
download "$war" "jenkins.war" || exit 1 | ||
war=jenkins.war | ||
fi | ||
|
||
if [[ ! -f $war ]]; then | ||
wardir=~/.m2/repository/org/jenkins-ci/main/jenkins-war | ||
|
||
war=$wardir/$2/jenkins-war-$2.war | ||
if [[ ! -f $war ]]; then | ||
mvn -B org.apache.maven.plugins:maven-dependency-plugin:2.7:get \ | ||
-DremoteRepositories=repo.jenkins-ci.org::::https://repo.jenkins-ci.org/public/ \ | ||
"-Dartifact=org.jenkins-ci.main:jenkins-war:$2:war" | ||
fi | ||
|
||
if [[ ! -f $war ]]; then | ||
echo 'No such jenkins.war. Available local versions:' | ||
ls $wardir/*/jenkins-war-*.war | sed -r -e 's/.*jenkins-war-(.+)\.war/\1/' | ||
exit 1 | ||
fi | ||
fi | ||
|
||
shift 2 | ||
|
||
set -x | ||
|
||
BROWSER=$browser JENKINS_WAR=$war mvn --show-version --no-transfer-progress test "$@" | ||
BROWSER=$browser JENKINS_WAR=$war $MVN test $extra_args "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistent with core and BOM: even though in practice these are Kubernetes agents, we respect the contract provided by the infrastructure team by not relying on this implementation detail.