-
Notifications
You must be signed in to change notification settings - Fork 10
/
.gitlab-ci.yml
47 lines (43 loc) · 1.79 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
stages:
- build
- deploy
- benchmarks
- ci-build
variables:
LATEST_LIBRARY_x86_64_LINUX_GNU:
value: "https://github.com/DataDog/dd-trace-php/releases/download/0.83.1/dd-library-php-0.83.1-x86_64-linux-gnu.tar.gz"
description: "Location where to download latest dd-library-php-*-x86_64-linux-gnu.tar.gz archive"
DOWNSTREAM_REL_BRANCH:
value: "master"
description: "Run a specific datadog-reliability-env branch downstream"
include:
- remote: https://gitlab-templates.ddbuild.io/libdatadog/include/ci_authenticated_job.yml
- local: .gitlab/benchmarks.yml
- local: .gitlab/ci-images.yml
build:
stage: build
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/base:bionic
tags: [ "runner:main", "size:large" ]
script:
- echo $LATEST_LIBRARY_x86_64_LINUX_GNU | sed -E 's/.*dd-library-php-(.+)-x86_64-linux-gnu.tar.gz.*/UPSTREAM_TRACER_VERSION=\1/' >> upstream.env
- curl --fail --location --output 'dd-library-php-x86_64-linux-gnu.tar.gz' "$LATEST_LIBRARY_x86_64_LINUX_GNU"
- curl --fail --location -O "$(dirname $LATEST_LIBRARY_x86_64_LINUX_GNU)/datadog-setup.php"
- tar -cf 'datadog-setup-x86_64-linux-gnu.tar' 'datadog-setup.php' 'dd-library-php-x86_64-linux-gnu.tar.gz'
artifacts:
paths:
- 'upstream.env'
- 'datadog-setup-x86_64-linux-gnu.tar'
deploy_to_reliability_env:
stage: deploy
trigger:
project: DataDog/apm-reliability/datadog-reliability-env
branch: $DOWNSTREAM_REL_BRANCH
variables:
UPSTREAM_PACKAGE_JOB: build
UPSTREAM_PROJECT_ID: $CI_PROJECT_ID
UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME
UPSTREAM_PIPELINE_ID: $CI_PIPELINE_ID
UPSTREAM_BRANCH: $CI_COMMIT_REF_NAME
# COMMIT_SHA would be wrong because the artifact is not built here
# UPSTREAM_COMMIT_SHA: $CI_COMMIT_SHA
FORCE_TRIGGER: $FORCE_TRIGGER