Skip to content

Commit

Permalink
feat: better structure and more parameters (#12)
Browse files Browse the repository at this point in the history
Co-authored-by: Steffen Neubauer <steffen@garden.io>
Co-authored-by: Srihas <srihas@garden.io>
  • Loading branch information
3 people committed Apr 19, 2023
1 parent 2a76911 commit 1228e6b
Show file tree
Hide file tree
Showing 20 changed files with 1,863 additions and 1,394 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,12 @@ jobs:
- name: Setup Cloud Formation Formatter
if: ${{ steps.release.outputs.release_created }}
run: |
mkdir -p rain/bin
cd rain
gh release download --repo aws-cloudformation/rain --pattern "*_linux-amd64.zip" --output "rain.zip"
unzip -j "rain.zip" "*/rain"
cd bin
unzip -j ../rain.zip "*/rain"
echo "$PWD" >> "$GITHUB_PATH"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -47,8 +51,7 @@ jobs:
run: |
npm install
npm run synth
./rain fmt cdk.out/garden-dev-cluster.template.json > garden-dev-cluster.template.yaml
cat garden-dev-cluster.template.yaml
npm run rain
env:
CDK_RELEASE_VERSION: "${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }}.${{ steps.release.outputs.patch }}"

Expand All @@ -59,7 +62,7 @@ jobs:
name: release-assets
path: |
cdk.out
garden-dev-cluster.template.yaml
*.template.yaml
upload-assets:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -115,4 +118,9 @@ jobs:
env:
AWS_REGION: ${{ matrix.region }}

- run: aws s3 cp garden-dev-cluster.template.yaml s3://garden-cfn-public-releases/dev-cluster/${{ needs.release-please.outputs.release_version }}/garden-dev-cluster.template.yaml
- name: Publish the CloudFormation templates
if: ${{ matrix.region == 'eu-central-1' }}
run: |
npm run upload-templates
env:
CDK_RELEASE_VERSION: ${{ needs.release-please.outputs.release_version }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
errors
cdk.out
cdk.context.json
*.template.yaml
10 changes: 8 additions & 2 deletions bootstrap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@ This only needs to be executed once.
# Bucket directory structure

- `garden-cfn-public-<region>/`
- `dev-cluster/`: Files related to the dev-cluster CDK stack
- `dev-cluster/`: Files related to the garden-dev-cluster CDK stack
- `x.x.x/`: semver release directory
- `<hash>.{json,zip}`: cdk asset created by synth
- `eks-blueprint/`: Files related to the eks-blueprint CDK stack
- `x.x.x/`: semver release directory
- `<hash>.{json,zip}`: cdk asset created by synth

- `garden-cfn-public-releases/`
- `dev-cluster/`: Files related to the dev-cluster CDK stack
- `dev-cluster/`: Files related to the garden-dev-cluster CDK stack
- `x.x.x/`: semver release directory
- `garden-dev-cluster.template.yaml`: CloudFormation stack synthesized from CDK code
- `eks-blueprint/`: Files related to the eks-blueprint CDK stack
- `x.x.x/`: semver release directory
- `eks-blueprint.template.yaml`: CloudFormation stack synthesized from CDK code

# How to create or update cfn stacks

Expand Down
8 changes: 1 addition & 7 deletions cdk.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
{
"app": "npx ts-node main.ts",
"context": {
"hostedZoneId": "Z028702323WOQ31QJAJJP",
"subdomainName": "dev.marketplace.sys.garden",
"iamUsers": "",
"iamRole": "arn:aws:sts::049586690729:assumed-role/AWSReservedSSO_AdministratorAccess_b3c1cae6dc09120a"
}
"app": "ts-node -P tsconfig.json --prefer-ts-exts src"
}
107 changes: 0 additions & 107 deletions cluster.ts

This file was deleted.

28 changes: 0 additions & 28 deletions ecr.ts

This file was deleted.

19 changes: 19 additions & 0 deletions edge-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# This script is meant to be used for end-to-end testing, so we can test the whole thing without actually releasing it on github.

set -e -o pipefail

export CDK_RELEASE_VERSION=edge

cd $(dirname $0)

npm install
npm run synth
npm run rain
npm run upload-assets
npm run upload-templates

echo
echo "Quick start: https://console.aws.amazon.com/cloudformation/home#/stacks/quickcreate?stackName=garden-dev-cluster&templateURL=https://garden-cfn-public-releases.s3.amazonaws.com/dev-cluster/$CDK_RELEASE_VERSION/garden-dev-cluster.template.yaml"
echo "Template URL: https://garden-cfn-public-releases.s3.amazonaws.com/dev-cluster/$CDK_RELEASE_VERSION/garden-dev-cluster.template.yaml"
27 changes: 0 additions & 27 deletions main.ts

This file was deleted.

Loading

0 comments on commit 1228e6b

Please sign in to comment.