forked from DataDog/helm-charts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
55 lines (53 loc) · 2.04 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
stages:
- e2e
variables:
RUN_E2E_TEST:
description: "set RUN_E2E_TEST to 'true' if you want to trigger the e2e test on your pipeline."
e2e:
stage: e2e
rules:
- if: '$CI_COMMIT_BRANCH =~ /^mq-working-branch-/'
changes:
paths:
- charts/datadog/*.yaml
- test/**/*
compare_to: "refs/heads/main"
when: always
- if: '$CI_COMMIT_BRANCH =~ /^mq-working-branch-/'
when: never
- if: $CI_COMMIT_BRANCH == "main"
changes:
paths:
- charts/datadog/**
- test/**/*
compare_to: "refs/heads/main"
when: always
- if: $RUN_E2E_TEST == "true"
when: manual
- when: never
image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/test-infra-definitions/runner:95dca87f269a
tags: ["arch:amd64"]
variables:
AWS_KEYPAIR_NAME: datadog-agent-ci
AWS_PRIVATE_KEY_FILE: $CI_PROJECT_DIR/ssh_key
KUBERNETES_CPU_REQUEST: 2
KUBERNETES_MEMORY_REQUEST: 4Gi
KUBERNETES_MEMORY_LIMIT: 12Gi
before_script:
- mkdir -p ~/.aws
- set +x
# Set GITHUB_TOKEN to avoid getting rate-limited when pulumi sdk downloads the kubernetes provider
- export GITHUB_TOKEN=$(aws ssm get-parameter --region us-east-1 --name ci.helm-charts.github_token --with-decryption --query "Parameter.Value" --out text)
# Configure AWS EC2 ssh key needed for create pulumi EKS environment
- aws ssm get-parameter --region us-east-1 --name ci.helm-charts.ssh_key --with-decryption --query "Parameter.Value" --out text > $AWS_PRIVATE_KEY_FILE
- set -x
# Without the newline ssh silently fails and moves on to try other auth methods
- echo "" >> $AWS_PRIVATE_KEY_FILE
- chmod 600 $AWS_PRIVATE_KEY_FILE
# Configure AWS profile
- aws ssm get-parameter --region us-east-1 --name ci.helm-charts.e2e-agent-qa-profile --with-decryption --query "Parameter.Value" --out text >> ~/.aws/config
- set -x
- export AWS_PROFILE=agent-qa-ci
- pulumi login "s3://dd-pulumi-state?region=us-east-1&awssdk=v2&profile=$AWS_PROFILE"
script:
- make test-e2e