Skip to content

Commit aba4411

Browse files
chore: use the new layer builders instead of the old ones
1 parent 6ca47d7 commit aba4411

File tree

1 file changed

+23
-95
lines changed

1 file changed

+23
-95
lines changed

.gitlab/templates/pipeline.yaml.tpl

Lines changed: 23 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -110,88 +110,16 @@ layer ({{ $flavor.name }}):
110110
111111
{{ range $architecture := (ds "architectures").architectures }}
112112
113-
build go agent ({{ $architecture.name }}):
114-
stage: build
115-
image: registry.ddbuild.io/images/docker:20.10
116-
tags: ["arch:amd64"]
117-
artifacts:
118-
expire_in: 1 hr
119-
paths:
120-
- .layers/datadog_extension-{{ $architecture.name }}.zip
121-
- .layers/datadog_extension-{{ $architecture.name }}/*
122-
variables:
123-
ARCHITECTURE: {{ $architecture.name }}
124-
script:
125-
- echo "Building go agent based on $AGENT_BRANCH"
126-
- cd .. && git clone -b $AGENT_BRANCH --single-branch https://github.com/DataDog/datadog-agent.git && cd datadog-lambda-extension
127-
- .gitlab/scripts/build_go_agent.sh
128-
129-
build bottlecap ({{ $architecture.name }}):
130-
stage: build
131-
image: registry.ddbuild.io/images/docker:20.10
132-
tags: ["arch:amd64"]
133-
needs:
134-
- build go agent ({{ $architecture.name }})
135-
dependencies:
136-
- build go agent ({{ $architecture.name }})
137-
artifacts:
138-
expire_in: 1 hr
139-
paths:
140-
- .layers/datadog_bottlecap-{{ $architecture.name }}.zip
141-
- .layers/datadog_bottlecap-{{ $architecture.name }}/*
142-
variables:
143-
ARCHITECTURE: {{ $architecture.name }}
144-
script:
145-
- .gitlab/scripts/build_bottlecap.sh
146-
147-
# Alpine
148-
build go agent ({{ $architecture.name }}, alpine):
149-
stage: build
150-
image: registry.ddbuild.io/images/docker:20.10
151-
tags: ["arch:amd64"]
152-
artifacts:
153-
expire_in: 1 hr
154-
paths:
155-
- .layers/datadog_extension-{{ $architecture.name }}-alpine.zip
156-
- .layers/datadog_extension-{{ $architecture.name }}-alpine/*
157-
variables:
158-
ARCHITECTURE: {{ $architecture.name }}
159-
ALPINE: 1
160-
script:
161-
- echo "Building go agent based on $AGENT_BRANCH"
162-
- cd .. && git clone -b $AGENT_BRANCH --single-branch https://github.com/DataDog/datadog-agent.git && cd datadog-lambda-extension
163-
- .gitlab/scripts/build_go_agent.sh
164-
165-
build bottlecap ({{ $architecture.name }}, alpine):
166-
stage: build
167-
image: registry.ddbuild.io/images/docker:20.10
168-
tags: ["arch:amd64"]
169-
needs:
170-
- build go agent ({{ $architecture.name }}, alpine)
171-
dependencies:
172-
- build go agent ({{ $architecture.name }}, alpine)
173-
artifacts:
174-
expire_in: 1 hr
175-
paths:
176-
- .layers/datadog_bottlecap-{{ $architecture.name }}-alpine.zip
177-
- .layers/datadog_bottlecap-{{ $architecture.name }}-alpine/*
178-
variables:
179-
ARCHITECTURE: {{ $architecture.name }}
180-
ALPINE: 1
181-
script:
182-
- .gitlab/scripts/build_bottlecap.sh
183-
# Alpine end
184-
185113
check layer size ({{ $architecture.name }}):
186114
stage: test
187115
image: registry.ddbuild.io/images/docker:20.10
188116
tags: ["arch:amd64"]
189117
needs:
190-
- build bottlecap ({{ $architecture.name }})
118+
- layer ({{ $architecture.name }})
191119
dependencies:
192-
- build bottlecap ({{ $architecture.name }})
120+
- layer ({{ $architecture.name }})
193121
variables:
194-
LAYER_FILE: datadog_bottlecap-{{ $architecture.name }}.zip
122+
LAYER_FILE: datadog_extension-{{ $architecture.name }}.zip
195123
script:
196124
- .gitlab/scripts/check_layer_size.sh
197125
@@ -206,13 +134,13 @@ sign layer ({{ $architecture.name }}):
206134
- if: '$CI_COMMIT_TAG =~ /^v.*/'
207135
when: manual
208136
needs:
209-
- build bottlecap ({{ $architecture.name }})
137+
- layer ({{ $architecture.name }})
210138
- check layer size ({{ $architecture.name }})
211139
- cargo fmt ({{ $architecture.name }})
212140
- cargo check ({{ $architecture.name }})
213141
- cargo clippy ({{ $architecture.name }})
214142
dependencies:
215-
- build bottlecap ({{ $architecture.name }})
143+
- layer ({{ $architecture.name }})
216144
artifacts: # Re specify artifacts so the modified signed file is passed
217145
expire_in: 1 day # Signed layers should expire after 1 day
218146
paths:
@@ -238,7 +166,7 @@ publish layer {{ $environment.name }} ({{ $architecture.name }}):
238166
{{ if or (eq $environment.name "prod") }}
239167
- sign layer ({{ $architecture.name }})
240168
{{ else }}
241-
- build bottlecap ({{ $architecture.name }})
169+
- layer ({{ $architecture.name }})
242170
- check layer size ({{ $architecture.name }})
243171
- cargo fmt ({{ $architecture.name }})
244172
- cargo check ({{ $architecture.name }})
@@ -248,7 +176,7 @@ publish layer {{ $environment.name }} ({{ $architecture.name }}):
248176
{{ if or (eq $environment.name "prod") }}
249177
- sign layer ({{ $architecture.name }})
250178
{{ else }}
251-
- build bottlecap ({{ $architecture.name }})
179+
- layer ({{ $architecture.name }})
252180
{{ end }}
253181
parallel:
254182
matrix:
@@ -270,12 +198,12 @@ publish private images:
270198
tags: ["arch:amd64"]
271199
image: ${CI_DOCKER_TARGET_IMAGE}:${CI_DOCKER_TARGET_VERSION}
272200
needs:
273-
- build bottlecap (arm64)
274-
- build bottlecap (amd64)
201+
- layer (arm64)
202+
- layer (amd64)
275203
when: manual
276204
dependencies:
277-
- build bottlecap (arm64)
278-
- build bottlecap (amd64)
205+
- layer (arm64)
206+
- layer (amd64)
279207
before_script:
280208
- EXTERNAL_ID_NAME={{ $environment.external_id }} ROLE_TO_ASSUME={{ $environment.role_to_assume }} AWS_ACCOUNT={{ $environment.account }} source .gitlab/scripts/get_secrets.sh
281209
script:
@@ -286,12 +214,12 @@ publish private images (alpine):
286214
tags: ["arch:amd64"]
287215
image: ${CI_DOCKER_TARGET_IMAGE}:${CI_DOCKER_TARGET_VERSION}
288216
needs:
289-
- build bottlecap (arm64, alpine)
290-
- build bottlecap (amd64, alpine)
217+
- layer (arm64, alpine)
218+
- layer (amd64, alpine)
291219
when: manual
292220
dependencies:
293-
- build bottlecap (arm64, alpine)
294-
- build bottlecap (amd64, alpine)
221+
- layer (arm64, alpine)
222+
- layer (amd64, alpine)
295223
variables:
296224
ALPINE: 1
297225
before_script:
@@ -311,11 +239,11 @@ build images:
311239
rules:
312240
- if: '$CI_COMMIT_TAG =~ /^v.*/'
313241
needs:
314-
- build bottlecap (arm64)
315-
- build bottlecap (amd64)
242+
- layer (arm64)
243+
- layer (amd64)
316244
dependencies:
317-
- build bottlecap (arm64)
318-
- build bottlecap (amd64)
245+
- layer (arm64)
246+
- layer (amd64)
319247
script:
320248
- .gitlab/scripts/build_image.sh
321249

@@ -326,11 +254,11 @@ build images (alpine):
326254
rules:
327255
- if: '$CI_COMMIT_TAG =~ /^v.*/'
328256
needs:
329-
- build bottlecap (arm64, alpine)
330-
- build bottlecap (amd64, alpine)
257+
- layer (arm64, alpine)
258+
- layer (amd64, alpine)
331259
dependencies:
332-
- build bottlecap (arm64, alpine)
333-
- build bottlecap (amd64, alpine)
260+
- layer (arm64, alpine)
261+
- layer (amd64, alpine)
334262
variables:
335263
ALPINE: 1
336264
script:

0 commit comments

Comments
 (0)