Skip to content

Commit 19b6564

Browse files
authored
Merge pull request #14 from commitdev/integrate-new-apply-command
Added features necessary to support the new zero apply command
2 parents 01a0e25 + 69a9f07 commit 19b6564

2 files changed

Lines changed: 12 additions & 8 deletions

File tree

Makefile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
# The following parameters are required:
2-
# - GITHUB_ORG
3-
# - GITHUB_REPO
4-
# - CIRCLECI_TOKEN
2+
# - REPOSITORY
3+
# - CIRCLECI_API_KEY
54
#
65

7-
AWS_ACCESS_KEY_ID := $(shell aws secretsmanager get-secret-value --secret-id=ci-user-aws-keys | jq -r '.SecretString'| jq -r .access_key_id)
8-
AWS_SECRET_ACCESS_KEY := $(shell aws secretsmanager get-secret-value --secret-id=ci-user-aws-keys | jq -r '.SecretString'| jq -r .secret_key)
6+
AWS_ACCESS_KEY_ID := $(shell aws secretsmanager get-secret-value --secret-id=ci-user-aws-keys${randomSeed} | jq -r '.SecretString'| jq -r .access_key_id)
7+
AWS_SECRET_ACCESS_KEY := $(shell aws secretsmanager get-secret-value --secret-id=ci-user-aws-keys${randomSeed} | jq -r '.SecretString'| jq -r .secret_key)
8+
GITHUB_ORG := $(shell echo ${REPOSITORY} | cut -d "/" -f 2)
9+
GITHUB_REPO := $(shell echo ${REPOSITORY} | cut -d "/" -f 3)
910

1011
run:
1112
@echo "Set CIRCLECI environment variables\n"
12-
curl -X POST --header "Content-Type: application/json" -d '{"name":"AWS_ACCESS_KEY_ID", "value":"${AWS_ACCESS_KEY_ID}"}' https://circleci.com/api/v1.1/project/github/${GITHUB_ORG}/${GITHUB_REPO}/envvar?circle-token=${CIRCLECI_TOKEN}
13-
curl -X POST --header "Content-Type: application/json" -d '{"name":"AWS_SECRET_ACCESS_KEY", "value":"${AWS_SECRET_ACCESS_KEY}"}' https://circleci.com/api/v1.1/project/github/${GITHUB_ORG}/${GITHUB_REPO}/envvar?circle-token=${CIRCLECI_TOKEN}
13+
curl -X POST --header "Content-Type: application/json" -d '{"name":"AWS_ACCESS_KEY_ID", "value":"${AWS_ACCESS_KEY_ID}"}' https://circleci.com/api/v1.1/project/github/${GITHUB_ORG}/${GITHUB_REPO}/envvar?circle-token=${CIRCLECI_API_KEY}
14+
curl -X POST --header "Content-Type: application/json" -d '{"name":"AWS_SECRET_ACCESS_KEY", "value":"${AWS_SECRET_ACCESS_KEY}"}' https://circleci.com/api/v1.1/project/github/${GITHUB_ORG}/${GITHUB_REPO}/envvar?circle-token=${CIRCLECI_API_KEY}
1415
@echo "\nFollow CIRCLECI project"
15-
curl -X POST https://circleci.com/api/v1.1/project/github/${GITHUB_ORG}/${GITHUB_REPO}/follow?circle-token=${CIRCLECI_TOKEN}
16+
curl -X POST https://circleci.com/api/v1.1/project/github/${GITHUB_ORG}/${GITHUB_REPO}/follow?circle-token=${CIRCLECI_API_KEY}
1617
@echo "\nDone"
1718

zero-module.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ parameters:
3939
- field: stagingBackendSubdomain
4040
label: Staging Backend Host Name (e.g. api.)
4141
default: api.
42+
- field: randomSeed
43+
label: Random seed that will be shared between projects to come up with deterministic resource names
44+
execute: uuidgen | head -c 8

0 commit comments

Comments
 (0)