From 1b1e7b8e91807cf50dcdcd95c0b37cf3b6ca9776 Mon Sep 17 00:00:00 2001 From: Gasper Kojek Date: Wed, 29 Jan 2025 13:00:16 +0100 Subject: [PATCH 1/2] Added the basic Develocity configuration --- .mvn/develocity.xml | 43 +++++++++++++++++++++++++++++++++++++++++++ .mvn/extensions.xml | 27 +++++++++++++++++++++++++++ README.md | 1 + 3 files changed, 71 insertions(+) create mode 100644 .mvn/develocity.xml create mode 100644 .mvn/extensions.xml diff --git a/.mvn/develocity.xml b/.mvn/develocity.xml new file mode 100644 index 000000000..b3788d1b8 --- /dev/null +++ b/.mvn/develocity.xml @@ -0,0 +1,43 @@ + + + + + https://develocity-staging.eclipse.org + + automotive.mosaic + + + 0.0.0.0 + + + + + + + #{isFalse(env['JENKINS_URL'])} + + + + false + + + false + #{isTrue(env['JENKINS_URL'])} + + + diff --git a/.mvn/extensions.xml b/.mvn/extensions.xml new file mode 100644 index 000000000..21cf78cb8 --- /dev/null +++ b/.mvn/extensions.xml @@ -0,0 +1,27 @@ + + + + + com.gradle + develocity-maven-extension + 1.23 + + + com.gradle + common-custom-user-data-maven-extension + 2.0.1 + + \ No newline at end of file diff --git a/README.md b/README.md index 08222f65c..434ff5bc2 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ ![Size](https://img.shields.io/github/repo-size/eclipse/mosaic.svg)
[![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. From 479bcd59cfdf046c6b3635c9b6b19b5f506fb152 Mon Sep 17 00:00:00 2001 From: Gasper Kojek Date: Wed, 29 Jan 2025 13:16:06 +0100 Subject: [PATCH 2/2] Added Develocity configuration to Jenkinsfile --- .gitignore | 3 +++ Jenkinsfile | 39 +++++++++++++++++++++++++++++++-------- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index 9a893b9cb..150a9e1eb 100644 --- a/.gitignore +++ b/.gitignore @@ -60,6 +60,9 @@ buildNumber.properties .mvn/wrapper/maven-wrapper.jar .flattened-pom.xml +# Develocity +.mvn/.develocity/develocity-workspace-id + # MOSAIC *.log diff --git a/Jenkinsfile b/Jenkinsfile index 9fc50778f..31e6195c0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,3 +1,10 @@ +def secrets = [ + [path: 'cbi/automotive.mosaic/develocity.eclipse.org', secretValues: [ + [envVar: 'DEVELOCITY_ACCESS_KEY', vaultKey: 'api-token'] + ] + ] +] + pipeline { agent { kubernetes { @@ -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" @@ -52,6 +62,9 @@ spec: persistentVolumeClaim: claimName: "tools-claim-jiro-mosaic" readOnly: true + - emptyDir: + medium: "" + name: "develocity-storage" """ } } @@ -64,7 +77,9 @@ 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' + } } } } @@ -72,7 +87,9 @@ spec: 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' + } } } @@ -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' + } } } @@ -100,7 +119,9 @@ spec: stage('Analysis') { steps { container('maven-sumo') { - sh 'mvn site' + withVault([vaultSecrets: secrets]) { + sh 'mvn site' + } } } @@ -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' + } } } }