forked from DataDog/system-tests
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
158 lines (150 loc) · 6.92 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
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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
.base_job:
image: tiangolo/docker-with-compose
needs: []
before_script:
- apk add bash jq git unzip curl
- pip install pyyaml awscli
- aws --version && docker --version && docker-compose --version
- export DD_API_KEY=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.dd_api_key --with-decryption --query "Parameter.Value" --out text)
- export GL_TOKEN=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.gl_token --with-decryption --query "Parameter.Value" --out text)
- export CIRCLECI_TOKEN=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.circleci_token --with-decryption --query "Parameter.Value" --out text)
variables:
# Do not modify this - must be the repository name for Kubernetes gitlab runners to run
KUBERNETES_SERVICE_ACCOUNT_OVERWRITE: system-tests #helm-charts
TEST: 1
.base_job_onboarding:
only:
- web
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/test-infra-definitions/runner:a58cc31c
tags: ["arch:amd64"]
before_script:
- apt-get update
- apt-get install -y jq
# Setup AWS Credentials
- mkdir -p ~/.aws
- aws ssm get-parameter --region us-east-1 --name ci.system-tests.agent-qa-profile --with-decryption --query "Parameter.Value" --out text >> ~/.aws/config
- export DD_API_KEY_ONBOARDING=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.dd-api-key-onboarding --with-decryption --query "Parameter.Value" --out text)
- export DD_APP_KEY_ONBOARDING=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.dd-app-key-onboarding --with-decryption --query "Parameter.Value" --out text)
- export ONBOARDING_AWS_INFRA_SUBNET_ID=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.aws-infra-subnet-id --with-decryption --query "Parameter.Value" --out text)
- export ONBOARDING_AWS_INFRA_SECURITY_GROUPS_ID=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.aws-infra-securiy-groups-id --with-decryption --query "Parameter.Value" --out text)
- export PULUMI_CONFIG_PASSPHRASE=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.pulumi-config-passphrase --with-decryption --query "Parameter.Value" --out text)
#Install plugins for PULUMI you need connect to gh. Sometimes this problem arises: GitHub rate limit exceeded
- export GITHUB_TOKEN=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.gh-token --with-decryption --query "Parameter.Value" --out text)
#We need authenticate on git repository
- export GITHUB_USER=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.gh-user --with-decryption --query "Parameter.Value" --out text)
- export GITHUB_MAIL=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.gh-mail --with-decryption --query "Parameter.Value" --out text)
#Avoid dockerhub rate limits
- export DOCKER_LOGIN=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.docker-login --with-decryption --query "Parameter.Value" --out text)
- export DOCKER_LOGIN_PASS=$(aws ssm get-parameter --region us-east-1 --name ci.system-tests.docker-login-pass --with-decryption --query "Parameter.Value" --out text)
- export AWS_PROFILE=agent-qa-ci
- pulumi login --local #"s3://dd-pulumi-state?region=us-east-1&awssdk=v2&profile=$AWS_PROFILE"
- pulumi plugin install resource command
- pulumi plugin install resource aws 5.41.0
#We need some variable for after script
- echo "GITHUB_USER=${GITHUB_USER}" >> .env_ci
- echo "GITHUB_MAIL=${GITHUB_MAIL}" >> .env_ci
- echo "GITHUB_TOKEN=${GITHUB_TOKEN}" >> .env_ci
after_script:
- export $(cat .env_ci | egrep -v "(^#.*|^$)" | xargs)
#Avoid pushing results to system-tests-dashboard until next iteration: - sh utils/scripts/push_reports_dashboard.sh
artifacts:
when: always
paths:
- logs_onboarding_host/
- logs_onboarding_host_container/
- logs_onboarding_container/
- logs_onboarding_host_auto_install/
- logs_onboarding_host_container_auto_install/
- logs_onboarding_container_auto_install/
cross-components:
extends: .base_job
stage: test
tags: ["runner:docker"]
only:
- schedules
parallel:
matrix:
- TEST_LIBRARY: php
WEBLOG_VARIANT: apache-mod-8.0
script:
- ./utils/scripts/load-binary.sh $TEST_LIBRARY
- ./build.sh
- ./run.sh
- ./run.sh SAMPLING
artifacts:
when: always
paths:
- binaries/
- logs/
- logs_sampling_rate/
cross-component-agent:
extends: .base_job
stage: test
tags: ["runner:docker"]
only:
- schedules
parallel:
matrix:
- TEST_LIBRARY: php
WEBLOG_VARIANT: apache-mod-8.0
script:
- ./utils/scripts/load-binary.sh agent
- ./utils/scripts/load-binary.sh $TEST_LIBRARY
- ./build.sh
- ./run.sh
- ./run.sh SAMPLING
artifacts:
when: always
paths:
- binaries/
- logs/
- logs_sampling_rate/
onboarding_nodejs:
extends: .base_job_onboarding
only:
- web
parallel:
matrix:
- TEST_LIBRARY: [nodejs]
SCENARIO: [ONBOARDING_HOST,ONBOARDING_HOST_CONTAINER,ONBOARDING_CONTAINER, ONBOARDING_HOST_AUTO_INSTALL, ONBOARDING_HOST_CONTAINER_AUTO_INSTALL, ONBOARDING_CONTAINER_AUTO_INSTALL]
script:
- echo "SCENARIO=${SCENARIO}" >> .env_ci && echo "TEST_LIBRARY=${TEST_LIBRARY}" >> .env_ci
- ./build.sh -i runner
- ./run.sh $SCENARIO
onboarding_java:
extends: .base_job_onboarding
only:
- web
parallel:
matrix:
- TEST_LIBRARY: [java]
SCENARIO: [ONBOARDING_HOST,ONBOARDING_HOST_CONTAINER,ONBOARDING_CONTAINER, ONBOARDING_HOST_AUTO_INSTALL, ONBOARDING_HOST_CONTAINER_AUTO_INSTALL, ONBOARDING_CONTAINER_AUTO_INSTALL]
script:
- echo "SCENARIO=${SCENARIO}" >> .env_ci && echo "TEST_LIBRARY=${TEST_LIBRARY}" >> .env_ci
- ./build.sh -i runner
- ./run.sh $SCENARIO
onboarding_python:
extends: .base_job_onboarding
only:
- web
parallel:
matrix:
- TEST_LIBRARY: [ python]
SCENARIO: [ONBOARDING_HOST,ONBOARDING_HOST_CONTAINER,ONBOARDING_CONTAINER, ONBOARDING_HOST_AUTO_INSTALL, ONBOARDING_HOST_CONTAINER_AUTO_INSTALL, ONBOARDING_CONTAINER_AUTO_INSTALL]
script:
- echo "SCENARIO=${SCENARIO}" >> .env_ci && echo "TEST_LIBRARY=${TEST_LIBRARY}" >> .env_ci
- ./build.sh -i runner
#Disabled PRO until fix ISSUE https://datadoghq.atlassian.net/browse/AIT-7405 released
- ONBOARDING_FILTER_ENV=dev ./run.sh $SCENARIO
onboarding_dotnet:
extends: .base_job_onboarding
only:
- web
parallel:
matrix:
- TEST_LIBRARY: [ dotnet]
SCENARIO: [ONBOARDING_HOST,ONBOARDING_HOST_CONTAINER,ONBOARDING_CONTAINER, ONBOARDING_HOST_AUTO_INSTALL, ONBOARDING_HOST_CONTAINER_AUTO_INSTALL, ONBOARDING_CONTAINER_AUTO_INSTALL]
script:
- echo "SCENARIO=${SCENARIO}" >> .env_ci && echo "TEST_LIBRARY=${TEST_LIBRARY}" >> .env_ci
- ./build.sh -i runner
- ./run.sh $SCENARIO