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

build: Added Develocity setup #467

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ buildNumber.properties
.mvn/wrapper/maven-wrapper.jar
.flattened-pom.xml

# Develocity
.mvn/.develocity/develocity-workspace-id

# MOSAIC

*.log
Expand Down
43 changes: 43 additions & 0 deletions .mvn/develocity.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!--
*******************************************************************************
* Copyright (c) 2025 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0/.
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* See git history
*******************************************************************************
-->
<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>automotive.mosaic</projectId>
<buildScan>
<obfuscation>
<ipAddresses>0.0.0.0</ipAddresses>
</obfuscation>
<publishing>
<onlyIf>
<![CDATA[authenticated]]>
</onlyIf>
</publishing>
<backgroundBuildScanUpload>#{isFalse(env['JENKINS_URL'])}</backgroundBuildScanUpload>
</buildScan>
<buildCache>
<local>
<enabled>false</enabled>
</local>
<remote>
<enabled>false</enabled>
<storeEnabled>#{isTrue(env['JENKINS_URL'])}</storeEnabled>
</remote>
</buildCache>
</develocity>
27 changes: 27 additions & 0 deletions .mvn/extensions.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
*******************************************************************************
* Copyright (c) 2025 Contributors to the Eclipse Foundation
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0/.
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* See git history
*******************************************************************************
-->
<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>
39 changes: 31 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
def secrets = [
[path: 'cbi/automotive.mosaic/develocity.eclipse.org', secretValues: [
[envVar: 'DEVELOCITY_ACCESS_KEY', vaultKey: 'api-token']
]
]
]

pipeline {
agent {
kubernetes {
Expand Down Expand Up @@ -26,6 +33,9 @@ spec:
- mountPath: "/opt/tools"
name: "volume-0"
readOnly: false
- mountPath: "/home/jenkins/.m2/.develocity"
name: "develocity-storage"
readOnly: false
resources:
limits:
memory: "2Gi"
Expand All @@ -52,6 +62,9 @@ spec:
persistentVolumeClaim:
claimName: "tools-claim-jiro-mosaic"
readOnly: true
- emptyDir:
medium: ""
name: "develocity-storage"
"""
}
}
Expand All @@ -64,15 +77,19 @@ spec:
stage('Build') {
steps {
container('maven-sumo') {
sh 'mvn clean install -DskipTests -fae -T 4'
withVault([vaultSecrets: secrets]) {
sh 'mvn clean install -DskipTests -fae -T 4'
}
}
}
}

stage('Test') {
steps {
container('maven-sumo') {
sh 'mvn test -fae -T 4 -P coverage'
withVault([vaultSecrets: secrets]) {
sh 'mvn test -fae -T 4 -P coverage'
}
}
}

Expand All @@ -86,7 +103,9 @@ spec:
stage('Integration Tests') {
steps {
container('maven-sumo') {
sh 'mvn test -fae -P integration-tests,coverage'
withVault([vaultSecrets: secrets]) {
sh 'mvn test -fae -P integration-tests,coverage'
}
}
}

Expand All @@ -100,7 +119,9 @@ spec:
stage('Analysis') {
steps {
container('maven-sumo') {
sh 'mvn site'
withVault([vaultSecrets: secrets]) {
sh 'mvn site'
}
}
}

Expand All @@ -123,10 +144,12 @@ spec:
}
steps {
container('maven-sumo') {
// sometimes this fails for unknown reason, so lets try it three times
retry(3) {
// requires the correct tool finding secrets
sh '/opt/tools/apache-maven/3.6.3/bin/mvn deploy -DskipTests'
withVault([vaultSecrets: secrets]) {
// sometimes this fails for unknown reason, so lets try it three times
retry(3) {
// requires the correct tool finding secrets
sh '/opt/tools/apache-maven/3.6.3/bin/mvn deploy -DskipTests'
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
![Size](https://img.shields.io/github/repo-size/eclipse/mosaic.svg) <br>
[![Build](https://github.com/eclipse/mosaic/workflows/Java%20CI%20with%20Maven/badge.svg)](https://github.com/eclipse/mosaic/actions?query=branch%3Amain+workflow%3A%22Java+CI+with+Maven%22)
[![Jenkins Build](https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.eclipse.org%2Fmosaic%2Fjob%2Fmosaic%2Fjob%2Fmain&label=Jenkins%20build)](https://ci.eclipse.org/mosaic/job/mosaic/)
[![Revved up by Develocity](https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?logo=Gradle&labelColor=02303A)](https://develocity-staging.eclipse.org/)


[**Eclipse MOSAIC**](https://eclipse.dev/mosaic) is a multi-scale simulation framework in the field of smart and connected mobility.
Expand Down