forked from DataDog/datadog-process-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
129 lines (120 loc) · 3.46 KB
/
.gitlab-ci.yml
File metadata and controls
129 lines (120 loc) · 3.46 KB
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
stages:
- triggers
- postbuild
- report
agent_x86_64:
stage: triggers
variables:
LONG_ARCH: x86_64
SHORT_ARCH: amd64
LLVM_ARCH: x86_64
trigger:
include: .gitlab-ci-x64.yml
strategy: depend
rules:
- when: always
agent_arm64:
stage: triggers
variables:
LONG_ARCH: aarch64
SHORT_ARCH: arm64
LLVM_ARCH: arm64
trigger:
include: .gitlab-ci-arm.yml
strategy: depend
rules:
- when: always
.merge_docker_manifest: &merge_docker_manifest
stage: postbuild
needs: [ agent_x86_64, agent_arm64 ]
trigger:
include: .gitlab-ci-docker.yml
strategy: depend
rules:
- when: on_success
merge_k8s_docker_manifest:
<<: *merge_docker_manifest
variables:
DST_REPOSITORY: quay.io/stackstate/stackstate-k8s-process-agent
DST_TAG: "$CI_COMMIT_REF_NAME"
merge_extra_k8s_docker_manifest:
<<: *merge_docker_manifest
variables:
DST_REPOSITORY: quay.io/stackstate/stackstate-k8s-process-agent
DST_TAG: "$CI_COMMIT_SHORT_SHA"
beest_k8s_1_33_containerd_trigger_verification:
stage: postbuild
needs: [ merge_extra_k8s_docker_manifest ]
variables:
PROCESS_AGENT_BRANCH_UNDER_TEST: "$CI_COMMIT_REF_NAME"
PROCESS_AGENT_HASH_UNDER_TEST: "$CI_COMMIT_SHORT_SHA"
TRIGGER_AGENT_X86_TESTS: "true"
rules:
- if: $CI_COMMIT_REF_NAME == "master"
when: manual
allow_failure: true
- if: $CI_COMMIT_BRANCH
when: manual
allow_failure: true
trigger:
project: stackvista/integrations/beest
notify-on-master-fail:
before_script:
- apk add --no-cache bash curl
image: ${REGISTRY_DOCKER_URL}/library/alpine:latest
only:
- master
script:
- SUITE=build ./.cerberus/cerberus_notify_failure.sh
stage: report
tags:
- sts-k8s-m-runner
when: on_failure
###########################
# Job to manage pushing images to Quay
##########################
# To run this job you need to specify 2 variables:
# SOURCE_IMAGE: the full URL of the image you want to push to Quay `(e.g. docker.io/stackstate/stackstate-k8s-process-agent:latest-amd64)`
# QUAY_IMAGE: the full URL of the destination image on Quay `(e.g. quay.io/stackstate/stackstate-k8s-process-agent:latest-amd64)`
push_image_to_quay:
stage: postbuild
image: ${REGISTRY_DOCKER_URL}/library/docker:20
services:
- alias: docker
command:
- --experimental
- --tls=false
name: ${REGISTRY_DOCKER_URL}/library/docker:20-dind
variables:
# We cannot access the host docker socket in GitLab CI, so we need to use the Docker-in-Docker service
DOCKER_DRIVER: overlay2
DOCKER_HOST: tcp://docker:2375
DOCKER_TLS_CERTDIR: ""
script:
- |
if [ ! -f remote-kube-cache-push.env ]; then
echo "remote-kube-cache-push.env file not found!"; exit 1;
fi
set -o allexport
source remote-kube-cache-push.env
set +o allexport
if [ -z "$SOURCE_IMAGE" ]; then
echo "SOURCE_IMAGE not set"
exit 1
fi
if [ -z "$QUAY_IMAGE" ]; then
echo "QUAY_IMAGE not set"
exit 1
fi
echo "Login to Quay.io..."
echo "${quay_password}" | docker login --username=${quay_user} --password-stdin quay.io
echo "Pull source image: $SOURCE_IMAGE"
docker pull "$SOURCE_IMAGE"
echo "Tag image for Quay: $QUAY_IMAGE"
docker tag "$SOURCE_IMAGE" "$QUAY_IMAGE"
echo "Push to Quay: $QUAY_IMAGE"
docker push "$QUAY_IMAGE"
rules:
- if: $CI_COMMIT_BRANCH == "master"
when: manual
allow_failure: true