File tree Expand file tree Collapse file tree 4 files changed +50
-1
lines changed
Expand file tree Collapse file tree 4 files changed +50
-1
lines changed Original file line number Diff line number Diff line change 1- FROM alpine:3.20.3
1+ FROM alpine:3.22.0
22
33ARG TOOLBOX_VERSION
44ENV TOOLBOX_VERSION="${TOOLBOX_VERSION}"
Original file line number Diff line number Diff line change @@ -154,6 +154,14 @@ snyk:
154154 # the Buildkite pipeline. Defaults to false.
155155 always_pass : false
156156
157+ # (Optional)
158+ # APM configuration section.
159+ apm :
160+ # (Optional)
161+ # APM service name to use for submitting metrics to datadog.
162+ # This is the name used for the CI pipelines.
163+ service_name : my-service-name
164+
157165# (Optional)
158166# Buildkite configuration section.
159167buildkite :
Original file line number Diff line number Diff line change @@ -87,6 +87,36 @@ _bk_sh_lint_step() {
8787EOF
8888}
8989
90+
91+ # #
92+ # # Print the APM environment variables.
93+ # #
94+ _bk_apm_environment_vars () {
95+ local workspace_filter=" ${1} "
96+ local deployment_service
97+ deployment_service=" $( config_value apm.service_name null) "
98+
99+ if [[ " ${deployment_service} " != null ]]; then
100+ local environment=" development"
101+ local is_production
102+
103+ while IFS=$' \t ' read -r is_production; do
104+ if [[ " ${is_production} " == true ]]; then
105+ environment=" production"
106+ fi
107+ cat << EOF
108+ env:
109+ DD_DEPLOYMENT_ENVIRONMENT: ${environment}
110+ DD_DEPLOYMENT_SERVICE: ${deployment_service}
111+ EOF
112+ done < <( jq -r \
113+ ' .terraform.workspaces // []
114+ | map(select(.name == "' " ${workspace_filter} " ' "))
115+ | map([.is_production])[]
116+ | @tsv' <<< " ${config_json}" )
117+ fi
118+ }
119+
90120# #
91121# # Print step that lints Terraform files.
92122# #
@@ -278,6 +308,7 @@ _bk_tf_apply_steps_filter() {
278308 concurrency: 1
279309 concurrency_group: ${_bk_pipeline_slug} /${workspace}
280310EOF
311+ _bk_apm_environment_vars " ${workspace} "
281312 done < <( jq -r \
282313 ' .terraform.workspaces // []
283314 ' " ${match_filter} " '
Original file line number Diff line number Diff line change 170170 }
171171 }
172172 },
173+ "apm" : {
174+ "type" : " object" ,
175+ "additionalProperties" : false ,
176+ "required" : [],
177+ "properties" : {
178+ "service_name" : {
179+ "type" : " string"
180+ }
181+ }
182+ },
173183 "snyk" : {
174184 "type" : " object" ,
175185 "additionalProperties" : false ,
You can’t perform that action at this time.
0 commit comments