-
Notifications
You must be signed in to change notification settings - Fork 35
/
.gitlab-ci.yml
48 lines (43 loc) · 1.11 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
variables:
DOCKER_TARGET_IMAGE: registry.ddbuild.io/ci/datadog-lambda-js
DOCKER_TARGET_VERSION: latest
stages:
- pre
- build
ci image:
stage: build
image: registry.ddbuild.io/images/docker:20.10
tags: ["arch:arm64"]
needs: []
rules:
- if: '$CI_COMMIT_BRANCH == "main" && $CI_PIPELINE_SOURCE == "push"'
changes:
- .gitlab/Dockerfile
when: on_success
variables:
DOCKER_TARGET: ${DOCKER_TARGET_IMAGE}:${DOCKER_TARGET_VERSION}
script:
- docker buildx build --platform linux/amd64,linux/arm64 --no-cache --pull --push --tag ${DOCKER_TARGET} -f .gitlab/Dockerfile .
.go-cache: &go-cache
key: datadog-lambda-js-go-cache
policy: pull
generator:
stage: pre
image: registry.ddbuild.io/images/mirror/golang:alpine
tags: ["arch:amd64"]
cache: *go-cache
script:
- apk add --no-cache gomplate
- gomplate --config .gitlab/config.yaml
artifacts:
paths:
- .gitlab/*-pipeline.yaml
build-layers:
stage: build
trigger:
include:
- artifact: .gitlab/build-pipeline.yaml
job: generator
strategy: depend
rules:
- when: on_success