forked from DataDog/dd-trace-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
30 lines (27 loc) · 1.08 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
stages:
- deploy
variables:
INDEX_FILE: index.txt
.common: &common
tags: [ "runner:main", "size:large" ]
copy_to_s3:
<<: *common
stage: deploy
image: registry.gitlab.com/gitlab-org/cloud-deploy/aws-base:latest
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
when: on_success
- if: '$CI_COMMIT_BRANCH == "testing"'
when: on_success
- when: manual
script:
- export ACCESS_KEY_ID=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-js.secret_key_id --with-decryption --query "Parameter.Value" --out text)
- export SECRET_ACCESS_KEY=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-js.secret_sec_key_id --with-decryption --query "Parameter.Value" --out text)
- export AWS_ACCESS_KEY_ID=$ACCESS_KEY_ID
- export AWS_SECRET_ACCESS_KEY=$SECRET_ACCESS_KEY
- echo $CI_COMMIT_REF_NAME >> $INDEX_FILE
- echo $CI_COMMIT_SHA >> $INDEX_FILE
- echo $GITLAB_USER_NAME >> $INDEX_FILE
- aws s3 cp $INDEX_FILE s3://datadog-reliability-env/node/$INDEX_FILE
- echo Wrote the following $INDEX_FILE to S3 ...
- cat $INDEX_FILE