-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
51 lines (43 loc) · 1.65 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
include:
# include the entire docker pipeline to build the backend docker image
- project: 'resengit/gitlab/pipeline-helpers'
ref: main
file: '/pipelines/docker-image-multi-arch.yaml'
# also include the templates for golang to define the job to build the shell client binary
- project: 'resengit/gitlab/pipeline-helpers'
ref: main
file: '/jobs/golang.yaml'
.parallel-matrix-config:
parallel:
matrix:
- PH_CUSTOM_PLATFORM: [linux/amd64, linux/arm64, linux/arm/v7]
create_distribution:
timeout: 3h
parallel: !reference [.parallel-matrix-config, parallel]
tags:
- platform-$PH_CUSTOM_PLATFORM
extends: .go-job-compile
script:
- |
IFS=/ read -r -d '' PH_CUSTOM_OS PH_CUSTOM_ARCH PH_CUSTOM_VARIANT < <(printf "%s\0" "$PH_CUSTOM_PLATFORM")
export PH_CUSTOM_PLATFORM_SLUG=${PH_CUSTOM_OS}-${PH_CUSTOM_ARCH}${PH_CUSTOM_VARIANT}
GO111MODULE=on go install go.opentelemetry.io/collector/cmd/[email protected]
export GOOS=$PH_CUSTOM_OS
export GOARCH=$PH_CUSTOM_ARCH
# remove the "v" prefix from the variant because GOARM wants only the number
export GOARM=${PH_CUSTOM_VARIANT//v/}
sed -i "s/name: otelcol-icos$/name: otelcol-icos-$PH_CUSTOM_PLATFORM_SLUG/g" otel-icos-config.yaml
.go/bin/builder --config=otel-icos-config.yaml
artifacts:
paths:
- otelcol-icos/otelcol-icos-*
build_docker:
parallel: !reference [.parallel-matrix-config, parallel]
tags:
- hw-$PH_CUSTOM_PLATFORM
variables:
PH_DOCKER_IMAGE_TAG_APPEND_PLATFORM_SLUG: "true"
container_scanning:
parallel: !reference [.parallel-matrix-config, parallel]
tags:
- platform-$PH_CUSTOM_PLATFORM