Skip to content

Commit 734227c

Browse files
authored
Run the Agent build on release branches instead of main from release … (DataDog#21046)
* Run the Agent build on release branches instead of main from release branches in integrations-core * Standardize release branch regex pattern
1 parent 6cb07fb commit 734227c

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

.gitlab/build_agent.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.build-agent-tpl:
33
variables:
44
# Pass these to triggered agent build job.
5+
AGENT_BRANCH: "main"
56
RELEASE_VERSION_6: "nightly"
67
RELEASE_VERSION_7: "nightly-a7"
78
BUCKET_BRANCH: "dev"
@@ -10,18 +11,23 @@
1011
# disable kitchen and e2e tests
1112
RUN_KITCHEN_TESTS: "false"
1213
RUN_E2E_TESTS: "off"
14+
# Override AGENT_BRANCH for release branches
15+
rules:
16+
- if: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^[0-9]+\.[0-9]+\.x$/
17+
variables:
18+
AGENT_BRANCH: $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
1319
stage: build
1420
trigger:
1521
project: DataDog/datadog-agent
16-
branch: main
22+
branch: $AGENT_BRANCH
1723
# It's more convenient to directly show if downstream pipeline succeeded.
1824
strategy: depend
1925

2026
build-agent-auto:
2127
extends: .build-agent-tpl
2228
rules:
2329
# Do not run on release branches
24-
- if: $CI_COMMIT_BRANCH =~ /^7\.\d+\.x$/
30+
- if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
2531
when: never
2632
# Only run if the branch is not a Github Merge Queue one.
2733
- if: $CI_COMMIT_BRANCH !~ /^gh-readonly-queue.*/
@@ -39,7 +45,7 @@ build-agent-manual-release:
3945
trigger:
4046
branch: $CI_COMMIT_BRANCH
4147
rules:
42-
- if: $CI_COMMIT_BRANCH =~ /^7\.\d+\.x$/
48+
- if: $CI_COMMIT_BRANCH =~ /^[0-9]+\.[0-9]+\.x$/
4349
when: manual
4450

4551
# Always have the option to run manually the agent build manually against the agent's main

0 commit comments

Comments
 (0)