Skip to content

Commit b644ac2

Browse files
committed
Testing workflow for vscode
1 parent e528dfc commit b644ac2

File tree

6 files changed

+23
-424
lines changed

6 files changed

+23
-424
lines changed

.github/workflows/test-cloudformation.yaml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,13 @@ jobs:
3838
id: deploy
3939
env:
4040
AWS_REGION: "${{ secrets.AWS_REGION }}"
41+
CLUSTER_ID: "${{ env.CLUSTER_ID }}"
4142
run: |
42-
aws cloudformation deploy --stack-name cfn-test-${CLUSTER_ID}-${TEST_BRANCH} \
43-
--template-file ./lab/cfn/eks-workshop-ide-cfn.yaml \
44-
--parameter-overrides RepositoryRef=${TEST_BRANCH} \
45-
--capabilities CAPABILITY_NAMED_IAM
43+
make deploy-ide environment="${CLUSTER_ID}"
4644
- name: Cleanup
4745
if: always()
4846
env:
4947
AWS_REGION: "${{ secrets.AWS_REGION }}"
48+
CLUSTER_ID: "${{ env.CLUSTER_ID }}"
5049
run: |
51-
aws cloudformation delete-stack --stack-name cfn-test-${CLUSTER_ID}-${TEST_BRANCH}
52-
aws cloudformation wait stack-delete-complete --stack-name cfn-test-${CLUSTER_ID}-${TEST_BRANCH}
50+
make destroy-ide environment="${CLUSTER_ID}"

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ create-infrastructure:
4141
destroy-infrastructure:
4242
bash hack/destroy-infrastructure.sh $(environment)
4343

44+
.PHONY: deploy-ide
45+
deploy-ide:
46+
bash hack/deploy-ide-cfn.sh $(environment)
47+
48+
.PHONY: destroy-ide
49+
destroy-ide:
50+
bash hack/destroy-ide-cfn.sh $(environment)
51+
4452
.PHONY: lint
4553
lint:
4654
yarn lint

hack/deploy-ide-cfn.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ outfile=$(mktemp)
1010

1111
bash $SCRIPT_DIR/build-ide-cfn.sh $outfile
1212

13-
aws cloudformation deploy --stack-name eks-workshop-ide1 \
13+
aws cloudformation deploy --stack-name "$EKS_CLUSTER_NAME-ide" \
1414
--capabilities CAPABILITY_NAMED_IAM --disable-rollback --template-file $outfile

hack/destroy-ide-cfn.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
6+
7+
source $SCRIPT_DIR/lib/common-env.sh
8+
9+
aws cloudformation delete-stack --stack-name "$EKS_CLUSTER_NAME-ide"
10+
aws cloudformation wait stack-delete-complete --stack-name "$EKS_CLUSTER_NAME-ide"

0 commit comments

Comments
 (0)