forked from DataDog/dd-trace-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
174 lines (157 loc) · 4.28 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
stages:
- package
- deploy
- benchmarks
- benchmarks-pr-comment
- single-step-instrumentation-tests
- manual_images
include:
- remote: https://gitlab-templates.ddbuild.io/apm/packaging.yml
- local: ".gitlab/benchmarks.yml"
- local: ".gitlab/single-step-instrumentation-tests.yml"
variables:
JS_PACKAGE_VERSION:
description: "Version to build for .deb and .rpm. Must be already published in NPM"
DOWNSTREAM_BRANCH:
value: "master"
description: "Run a specific datadog-reliability-env branch downstream"
.common: &common
tags: [ "runner:main", "size:large" ]
package-snapshot:
extends: .package
stage: package
rules:
- if: $JS_PACKAGE_VERSION
when: never
- if: '$CI_COMMIT_TAG =~ /^v.*/'
when: never
- if: $CI_COMMIT_BRANCH == 'master'
when: on_success
allow_failure: true
- when: manual
allow_failure: true
script:
- |
export CI_VERSION_SUFFIX=".pipeline.${CI_PIPELINE_ID}.beta.${CI_COMMIT_SHORT_SHA}"
cd ..
./.gitlab/build-deb-rpm-snapshot.sh
echo "done"
package-snapshot-arm:
extends: .package-arm
stage: package
rules:
- if: $JS_PACKAGE_VERSION
when: never
- if: '$CI_COMMIT_TAG =~ /^v.*/'
when: never
- if: $CI_COMMIT_BRANCH == 'master'
when: on_success
allow_failure: true
- when: manual
allow_failure: true
script:
- |
export CI_VERSION_SUFFIX=".pipeline.${CI_PIPELINE_ID}.beta.${CI_COMMIT_SHORT_SHA}"
cd ..
./.gitlab/build-deb-rpm-snapshot.sh
echo "done"
package:
extends: .package
rules:
- if: $JS_PACKAGE_VERSION
when: on_success
- if: '$CI_COMMIT_TAG =~ /^v.*/'
when: on_success
script:
- ../.gitlab/build-deb-rpm.sh
- find . -iregex '.*\.\(deb\|rpm\)' -printf '%f\0' | xargs -0 dd-pkg lint
package-arm:
extends: .package-arm
rules:
- if: $JS_PACKAGE_VERSION
when: on_success
- if: '$CI_COMMIT_TAG =~ /^v.*/'
when: on_success
script:
- ../.gitlab/build-deb-rpm.sh
- find . -iregex '.*\.\(deb\|rpm\)' -printf '%f\0' | xargs -0 dd-pkg lint
package-oci:
extends: .package-oci
stage: package
script:
- ../.gitlab/build_oci_package.sh
oci-internal-publish:
extends: .oci-internal-publish
stage: package
needs: [ package-oci ]
rules:
- when: on_success
variables:
FLAVOR: datadog-apm-library-js
oci-internal-test-ecr-publish:
stage: package
needs: [ oci-internal-publish ]
rules:
- when: on_success
trigger:
project: DataDog/public-images
branch: main
strategy: depend
variables:
IMG_SOURCES: registry.ddbuild.io/ci/remote-updates/datadog-apm-library-js:pipeline-${CI_PIPELINE_ID}-1
IMG_DESTINATIONS: apm-library-js-package:pipeline-${CI_PIPELINE_ID}
IMG_REGISTRIES: agent-qa
.release-package:
stage: deploy
variables:
PRODUCT_NAME: auto_inject-node
PACKAGE_FILTER: js # product name is "node" but package name ends "js"
deploy_to_reliability_env:
stage: deploy
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
when: on_success
- when: manual
allow_failure: true
trigger:
project: DataDog/apm-reliability/datadog-reliability-env
branch: $DOWNSTREAM_BRANCH
variables:
UPSTREAM_BRANCH: $CI_COMMIT_REF_NAME
UPSTREAM_PROJECT_ID: $CI_PROJECT_ID
UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME
UPSTREAM_COMMIT_SHA: $CI_COMMIT_SHA
generate-lib-init-tag-values:
tags: ["arch:amd64"]
image: registry.ddbuild.io/ci/auto_inject/gitlab:current
stage: deploy
rules:
# We don't tag prerelease versions
- if: '$CI_COMMIT_TAG =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/'
when: on_success
- when: manual
allow_failure: true
variables:
IMG_DESTINATION_BASE: dd-lib-js-init
script:
- ./.gitlab/build-lib-init.sh
artifacts:
reports:
dotenv: build.env
deploy-lib-init-trigger:
stage: deploy
# needs the version from the generate-tag-values job
needs:
- job: generate-lib-init-tag-values
artifacts: true
trigger:
# project: DataDog/dd-trace-dotnet-gitlab-test # can be used for testing
project: DataDog/public-images
branch: main
strategy: depend
variables:
IMG_SOURCES: ghcr.io/datadog/dd-trace-js/dd-lib-js-init:$CI_COMMIT_TAG
IMG_DESTINATIONS: $IMG_DESTINATIONS
IMG_SIGNING: "false"
RETRY_COUNT: 5
RETRY_DELAY: 300