Skip to content

Commit

Permalink
HSEARCH-5094 Make the build env tag available in Develocity on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
yrodiere committed Feb 29, 2024
1 parent a6ed184 commit 93cf3c1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Jenkinsfile
Expand Up @@ -963,13 +963,9 @@ void mavenNonDefaultBuild(BuildEnvironment buildEnv, String args, List<String> a

pullContainerImages( args )

// Add a suffix to tests to distinguish between different executions
// of the same test in different environments in reports
def testSuffix = buildEnv.tag.replaceAll('[^a-zA-Z0-9_\\-+]+', '_')

// Note "clean" is necessary here in order to store the result of the build in the remote build cache
sh """ \
mvn clean install -Pci-build -Dsurefire.environment=$testSuffix \
mvn clean install -Pci-build \
${toTestJdkArg(buildEnv)} \
--fail-at-end \
$args \
Expand All @@ -988,6 +984,13 @@ void mavenNonDefaultBuild(BuildEnvironment buildEnv, String args, List<String> a
String toTestJdkArg(BuildEnvironment buildEnv) {
String args = ''

// Make the build env tag available in Develocity
args += "-Dscan.tag.${buildEnv.tag}"
// Add a suffix to tests to distinguish between different executions
// of the same test in different environments in reports
def testSuffix = buildEnv.tag.replaceAll('[^a-zA-Z0-9_\\-+]+', '_')
args += "-Dsurefire.environment=$testSuffix -Dscan.tag.${buildEnv.tag}"

if ( ! (buildEnv instanceof JdkBuildEnvironment) ) {
return args;
}
Expand Down

0 comments on commit 93cf3c1

Please sign in to comment.