-
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
Conversation
eeceb34
to
6d87e07
Compare
node('maven-11') { | ||
checkout scm | ||
sh "mvn verify --no-transfer-progress -DskipTests -P jenkins-release" | ||
retry(count: 2, conditions: [kubernetesAgent(handleNonKubernetes: true), nonresumable()]) { |
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.
node('maven-11') { | ||
checkout scm | ||
def mavenOptions = [ | ||
'-Dset.changelist', |
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.
Needed for producing incrementals.
'clean', | ||
'install', |
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.
Needed for infra.prepareToPublishIncrementals()
(as opposed to verify
).
'clean', | ||
'install', | ||
] | ||
infra.runMaven(mavenOptions, 11) |
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.
Internally respects MAVEN_SETTINGS
, preparing for the potential use of the artifact caching proxy.
@@ -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 comment
The reason will be displayed to describe this comment to others. Learn more.
See jenkinsci/bom#1842.
<!-- | ||
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> |
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.
Copying the trick I did in plugin-compat-tester
to define an unused test-scoped dependency to get Dependabot to automatically update jenkins.version
(actually used further below by the copy
mojo, which Dependabot can't update). I have confirmed this trick works. I am not interested in learning how to use any other dependency updating tools. I trust that those who are enthusiastic about other tools can find a better way to do this after this PR lands (or stick with this solution, which is "good enough", if they are not interested).
<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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
Filed #1098 for later improvement
MVN='mvn -V -e -ntp' | ||
if [[ -n ${MAVEN_SETTINGS-} ]]; then | ||
MVN="${MVN} -s ${MAVEN_SETTINGS}" | ||
fi |
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.
Observe MAVEN_SETTINGS
if defined in preparation for #963.
<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> |
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.
If you are reading this PR from top to bottom, this hunk will only make sense after you have read the changes to run.sh
.
*.war) | ||
download "$war" "jenkins.war" || exit 1 | ||
war=jenkins.war | ||
;; |
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.
Due to the [[ ! -f $war ]]; then
a few lines above, this is the case statement for URLs, not local file paths.
Used my admin powers to replay the build with the |
Fixes #736. Preparatory work for #963. See self-review for details.
High-level changes:
maven.repo.local
insideWORKSPACE_TMP
in CI, just like Setmaven.repo.local
insideWORKSPACE_TMP
in CI bom#1842.jenkins.version
inpom.xml
, where user-submitted PRs may set it to an incremental build. This version will be updated by Dependabot.latest
,lts
, or a version number are provided, haverun.sh
delegate to Maven rather than trying to do the download itself. Continue to support usages of a URL or a filesystem path to the WAR.MAVEN_SETTINGS
, if set. This is preparatory work for Use Jenkins project mirrors / caches #963.