Skip to content

Commit 5215ef4

Browse files
authored
CSA build updates (#2648)
* use appdynamics artifactory instead of github hackery * update to latest * only build a jar on gitlab * never not fighting gradle * spotless * tests that use autoconfigure need to reset * spotless * trying to simplify where this gitlab condition is actually needed... * Revert "trying to simplify where this gitlab condition is actually needed..." This reverts commit 1a102de.
1 parent bc9bca5 commit 5215ef4

1 file changed

Lines changed: 24 additions & 15 deletions

File tree

agent-csa-bundle/build.gradle.kts

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88

99
// This should be updated for every CSA release, eventually in dependencyManagement?
1010

11-
val csaVersion = "25.12.0-1409"
11+
val csaVersion = "26.2.0-1416"
1212
val otelInstrumentationVersion: String by rootProject.extra
1313

1414
base.archivesName.set("splunk-otel-javaagent-csa")
@@ -29,33 +29,27 @@ val splunkAgent: Configuration by configurations.creating {
2929
}
3030

3131
repositories {
32-
ivy {
33-
// Required to source artifact directly from github release page
34-
// https://github.com/signalfx/csa-releases/releases/download/<version>/oss-agent-mtagent-extension-deployment.jar
35-
url = uri("https://github.com/")
36-
metadataSources {
37-
artifact()
38-
}
39-
patternLayout {
40-
ivy("[organisation]/[module]/releases/download/[revision]/[artifact].[ext]")
41-
artifact("[organisation]/[module]/releases/download/[revision]/[artifact].[ext]")
42-
}
32+
maven {
33+
url = uri("https://artifactory.bare.appdynamics.com/artifactory/maven-releases/")
4334
}
4435
}
4536

4637
dependencies {
4738
splunkAgent(project(":agent", configuration = "shadow"))
48-
csaReleases("signalfx:csa-releases:$csaVersion") {
39+
csaReleases("com.cisco.security:secureapp-otel-java-extension:$csaVersion") {
4940
artifact {
50-
name = "oss-agent-mtagent-extension-deployment"
51-
extension = "jar"
41+
name = "secureapp-otel-java-extension"
42+
extension = "zip"
5243
}
5344
}
5445
}
5546

5647
tasks {
5748
// This exists purely to get the extension jar into our build dir
5849
val copyCsaJar by registering(Jar::class) {
50+
onlyIf("csa is only built from gitlab") {
51+
System.getenv("GITLAB_CI") != null
52+
}
5953
archiveFileName.set("oss-agent-mtagent-extension-deployment.jar")
6054
doFirst {
6155
from(zipTree(csaReleases.singleFile))
@@ -64,13 +58,19 @@ tasks {
6458

6559
// Extract and rename extension classes
6660
val extractExtensionClasses by registering(Copy::class) {
61+
onlyIf("csa is only built from gitlab") {
62+
System.getenv("GITLAB_CI") != null
63+
}
6764
dependsOn(copyCsaJar)
6865
from(zipTree(copyCsaJar.get().archiveFile))
6966
into("build/ext-exploded")
7067
}
7168

7269
// Rename class to classdata
7370
val renameClasstoClassdata by registering(Copy::class) {
71+
onlyIf("csa is only built from gitlab") {
72+
System.getenv("GITLAB_CI") != null
73+
}
7474
dependsOn(extractExtensionClasses)
7575
from("build/ext-exploded/com/cisco/mtagent/adaptors/")
7676
into("build/ext-exploded/com/cisco/mtagent/adaptors/")
@@ -81,12 +81,18 @@ tasks {
8181

8282
// Copy service file so path on disk matches path in jar
8383
val copyServiceFile by registering(Copy::class) {
84+
onlyIf("csa is only built from gitlab") {
85+
System.getenv("GITLAB_CI") != null
86+
}
8487
dependsOn(extractExtensionClasses)
8588
from("build/ext-exploded/META-INF/services/")
8689
into("build/ext-exploded/inst/META-INF/services/")
8790
}
8891

8992
val shadowCsaClasses by registering(ShadowJar::class) {
93+
onlyIf("csa is only built from gitlab") {
94+
System.getenv("GITLAB_CI") != null
95+
}
9096
archiveFileName.set("shadow-csa-classes.jar")
9197
dependsOn(copyServiceFile, renameClasstoClassdata, splunkAgent)
9298

@@ -117,6 +123,9 @@ tasks {
117123
}
118124

119125
jar {
126+
onlyIf("csa is only built from gitlab") {
127+
System.getenv("GITLAB_CI") != null
128+
}
120129
dependsOn(shadowCsaClasses)
121130
from(zipTree(shadowCsaClasses.get().archiveFile.get()))
122131
from(copyCsaJar.get().archiveFile.get())

0 commit comments

Comments
 (0)