Skip to content

Commit

Permalink
Align runner tags
Browse files Browse the repository at this point in the history
  • Loading branch information
0xnm committed Apr 12, 2024
1 parent 469c000 commit fc9b5d2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 29 deletions.
22 changes: 13 additions & 9 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ variables:
CI_IMAGE_DOCKER: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/dd-sdk-android-gradle-plugin:$CURRENT_CI_IMAGE
GIT_DEPTH: 5

DD_AGENT_HOST: "$BUILDENV_HOST_IP"
DD_SERVICE: "dd-sdk-android-gradle-plugin"
DD_ENV_TESTS: "ci"
DD_INTEGRATION_JUNIT_5_ENABLED: "true"
DD_CIVISIBILITY_ENABLED: "true"
DD_INSIDE_CI: "true"
DD_COMMON_AGENT_CONFIG: "dd.env=ci,dd.trace.enabled=false,dd.jmx.fetch.enabled=false"

KUBERNETES_MEMORY_REQUEST: "8Gi"
KUBERNETES_MEMORY_LIMIT: "16Gi"

stages:
- ci-image
Expand All @@ -29,7 +32,7 @@ ci-image:
stage: ci-image
when: manual
except: [ tags, schedules ]
tags: [ "runner:docker" ]
tags: [ "arch:amd64" ]
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/docker:24.0.4-gbi-focal
script:
- docker build --tag $CI_IMAGE_DOCKER -f Dockerfile.gitlab .
Expand All @@ -40,7 +43,7 @@ ci-image:
create_key:
stage: security
when: manual
tags: [ "runner:docker" ]
tags: [ "arch:amd64" ]
variables:
PROJECT_NAME: "dd-sdk-android-gradle-plugin"
EXPORT_TO_KEYSERVER: "true"
Expand All @@ -63,7 +66,7 @@ static-analysis:
strategy: depend

analysis:licenses:
tags: [ "runner:main" ]
tags: [ "arch:amd64" ]
image: $CI_IMAGE_DOCKER
stage: analysis
timeout: 30m
Expand All @@ -72,7 +75,7 @@ analysis:licenses:
- GRADLE_OPTS="-Xmx2560m" ./gradlew :dd-sdk-android-gradle-plugin:checkThirdPartyLicences --stacktrace --no-daemon

analysis:woke:
tags: [ "runner:main" ]
tags: [ "arch:amd64" ]
image: $CI_IMAGE_DOCKER
stage: analysis
timeout: 30m
Expand All @@ -83,15 +86,16 @@ analysis:woke:
# TESTS

test:plugin:
tags: [ "runner:main" ]
tags: [ "arch:amd64" ]
image: $CI_IMAGE_DOCKER
stage: test
timeout: 1h
script:
- git fetch --depth=1 origin main
- rm -rf ~/.gradle/daemon/
- CODECOV_TOKEN=$(aws ssm get-parameter --region us-east-1 --name ci.dd-sdk-android-gradle-plugin.codecov-token --with-decryption --query "Parameter.Value" --out text)
- GRADLE_OPTS="-Xmx2560m" ./gradlew :dd-sdk-android-gradle-plugin:test --stacktrace --no-daemon
- export DD_AGENT_HOST="$BUILDENV_HOST_IP"
- GRADLE_OPTS="-Xmx2560m" DD_TAGS="test.module:dd-sdk-android-gradle-plugin" ./gradlew :dd-sdk-android-gradle-plugin:test --stacktrace --no-daemon -Dorg.gradle.jvmargs=-javaagent:$(pwd)/libs/dd-java-agent-1.26.1.jar=$DD_COMMON_AGENT_CONFIG
- bash <(cat ./codecov.sh) -t $CODECOV_TOKEN
artifacts:
reports:
Expand All @@ -100,7 +104,7 @@ test:plugin:
# PUBLISH ARTIFACTS

publish:publish-sonatype:
tags: [ "runner:main" ]
tags: [ "arch:amd64" ]
only:
- tags
image: $CI_IMAGE_DOCKER
Expand All @@ -116,7 +120,7 @@ publish:publish-sonatype:
- ./gradlew :dd-sdk-android-gradle-plugin:publishPluginMavenPublicationToMavenRepository --stacktrace --no-daemon

publish:publish-gradle-portal:
tags: [ "runner:main" ]
tags: [ "arch:amd64" ]
only:
- tags
image: $CI_IMAGE_DOCKER
Expand Down
20 changes: 0 additions & 20 deletions buildSrc/src/main/kotlin/com/datadog/gradle/config/KotlinConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ package com.datadog.gradle.config

import org.gradle.api.JavaVersion
import org.gradle.api.Project
import org.gradle.api.tasks.testing.Test
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.File

fun Project.kotlinConfig() {
taskConfig<KotlinCompile> {
Expand All @@ -19,22 +17,4 @@ fun Project.kotlinConfig() {
jvmTarget = JavaVersion.VERSION_11.toString()
}
}

val moduleName = this@kotlinConfig.name
val javaAgentJar = File(File(rootDir, "libs"), "dd-java-agent-0.98.1.jar")
taskConfig<Test> {
if (environment["DD_INTEGRATION_JUNIT_5_ENABLED"] == "true") {
// set the `env` tag for the test spans
environment("DD_ENV", "ci")
// add custom tags based on the module and variant (debug/release, flavors, …)
environment("DD_TAGS", "test.module:$moduleName")

// disable other Datadog integrations that could interact with the Java Agent
environment("DD_INTEGRATIONS_ENABLED", "false")
// disable JMX integration
environment("DD_JMX_FETCH_ENABLED", "false")

jvmArgs("-javaagent:${javaAgentJar.absolutePath}")
}
}
}
Binary file not shown.

0 comments on commit fc9b5d2

Please sign in to comment.