Skip to content
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

Added basic develocity setup #25322 #25336

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@ appserver/tests/appserv-tests/temppwd

opendj-*.zip
/opendj/
.mvn/.develocity/develocity-workspace-id
13 changes: 13 additions & 0 deletions .mvn/develocity-extensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<extensions>
<extension>
<groupId>com.gradle</groupId>
<artifactId>develocity-maven-extension</artifactId>
<version>1.23</version>
</extension>
<extension>
<groupId>com.gradle</groupId>
<artifactId>common-custom-user-data-maven-extension</artifactId>
<version>2.0.1</version>
</extension>
</extensions>
29 changes: 29 additions & 0 deletions .mvn/develocity.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<develocity
xmlns="https://www.gradle.com/develocity-maven" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://www.gradle.com/develocity-maven https://www.gradle.com/schema/develocity-maven.xsd">
<server>
<url>https://develocity-staging.eclipse.org</url>
</server>
<projectId>glassfish</projectId>
<buildScan>
<obfuscation>
<ipAddresses>0.0.0.0</ipAddresses>
</obfuscation>
<publishing>
<onlyIf>
<![CDATA[authenticated]]>
</onlyIf>
</publishing>
<backgroundBuildScanUpload>#{isFalse(env['CI']) and isFalse(env['JENKINS_URL'])}</backgroundBuildScanUpload>
</buildScan>
<buildCache>
<local>
<enabled>false</enabled>
</local>
<remote>
<enabled>false</enabled>
<storeEnabled>#{isTrue(env['CI']) or isTrue(env['JENKINS_URL'])}</storeEnabled>
</remote>
</buildCache>
</develocity>
76 changes: 50 additions & 26 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/

def secrets = [
[path: 'cbi/ee4j.glassfish/develocity.eclipse.org', secretValues: [
[envVar: 'DEVELOCITY_ACCESS_KEY', vaultKey: 'api-token']
]
]
]

def dumpSysInfo() {
sh """
Expand Down Expand Up @@ -54,10 +60,10 @@ def antjobs = [
]

def parallelStagesMap = antjobs.collectEntries {
["${it}": generateAntPodTemplate(it)]
["${it}": generateAntPodTemplate(it, secrets)]
}

def generateAntPodTemplate(job) {
def generateAntPodTemplate(job, secrets) {
return {
node {
stage("${job}") {
Expand All @@ -66,12 +72,15 @@ def generateAntPodTemplate(job) {
timeout(time: 1, unit: 'HOURS') {
withAnt(installation: 'apache-ant-latest') {
dumpSysInfo()
sh """
mkdir -p ${WORKSPACE}/appserver/tests
tar -xzf ${WORKSPACE}/bundles/appserv_tests.tar.gz -C ${WORKSPACE}/appserver/tests
export CLASSPATH=${WORKSPACE}/glassfish7/javadb
${WORKSPACE}/appserver/tests/gftest.sh run_test ${job}
"""
withVault([vaultSecrets: secrets]) {
sh 'cp .mvn/develocity-extensions.xml .mvn/extensions.xml || true'
sh """
mkdir -p ${WORKSPACE}/appserver/tests
tar -xzf ${WORKSPACE}/bundles/appserv_tests.tar.gz -C ${WORKSPACE}/appserver/tests
export CLASSPATH=${WORKSPACE}/glassfish7/javadb
${WORKSPACE}/appserver/tests/gftest.sh run_test ${job}
"""
}
}
}
} finally {
Expand Down Expand Up @@ -119,6 +128,9 @@ spec:
readOnly: true
- name: maven-repo-local-storage
mountPath: "/home/jenkins/.m2/repository/org/glassfish/main"
- name: develocity-storage
mountPath: "/home/jenkins/.m2/.develocity"
readOnly: false
resources:
limits:
memory: "8Gi"
Expand Down Expand Up @@ -146,6 +158,9 @@ spec:
path: settings-security.xml
- name: maven-repo-local-storage
emptyDir: {}
- name: develocity-storage
emptyDir:
medium: ""
"""
}
}
Expand Down Expand Up @@ -186,18 +201,21 @@ spec:
checkout scm
container('maven') {
dumpSysInfo()
sh '''
# Validate the structure in all submodules (especially version ids)
mvn -B -e -fae clean validate -Ptck,set-version-id,staging
# Until we fix ANTLR in cmp-support-sqlstore, broken in parallel builds. Just -Pfast after the fix.
mvn -B -e install -Pfastest,staging -T4C
./gfbuild.sh archive_bundles
./gfbuild.sh archive_embedded
mvn -B -e clean -Pstaging
tar -c -C ${WORKSPACE}/appserver/tests common_test.sh gftest.sh appserv-tests quicklook | gzip --fast > ${WORKSPACE}/bundles/appserv_tests.tar.gz
ls -la ${WORKSPACE}/bundles
ls -la ${WORKSPACE}/embedded
'''
withVault([vaultSecrets: secrets]) {
sh 'cp .mvn/develocity-extensions.xml .mvn/extensions.xml || true'
sh '''
# Validate the structure in all submodules (especially version ids)
mvn -B -e -fae clean validate -Ptck,set-version-id,staging
# Until we fix ANTLR in cmp-support-sqlstore, broken in parallel builds. Just -Pfast after the fix.
mvn -B -e install -Pfastest,staging -T4C
./gfbuild.sh archive_bundles
./gfbuild.sh archive_embedded
mvn -B -e clean -Pstaging
tar -c -C ${WORKSPACE}/appserver/tests common_test.sh gftest.sh appserv-tests quicklook | gzip --fast > ${WORKSPACE}/bundles/appserv_tests.tar.gz
ls -la ${WORKSPACE}/bundles
ls -la ${WORKSPACE}/embedded
'''
}
}
archiveArtifacts artifacts: 'bundles/*.zip', onlyIfSuccessful: true
archiveArtifacts artifacts: 'embedded/*', onlyIfSuccessful: true
Expand All @@ -210,9 +228,12 @@ spec:
container('maven') {
dumpSysInfo()
timeout(time: 1, unit: 'HOURS') {
sh '''
mvn -B -e clean install -Pstaging,qa
'''
withVault([vaultSecrets: secrets]) {
sh 'cp .mvn/develocity-extensions.xml .mvn/extensions.xml || true'
sh '''
mvn -B -e clean install -Pstaging,qa
'''
}
}
}
}
Expand Down Expand Up @@ -245,9 +266,12 @@ spec:
container('maven') {
dumpSysInfo()
timeout(time: 1, unit: 'HOURS') {
sh '''
mvn -B -e clean install -Pstaging -f docs -amd
'''
withVault([vaultSecrets: secrets]) {
sh 'cp .mvn/develocity-extensions.xml .mvn/extensions.xml || true'
sh '''
mvn -B -e clean install -Pstaging -f docs -amd
'''
}
}
}
}
Expand Down