Skip to content

Commit cabb232

Browse files
Matt Calhounmcalhoun
andauthored
feature add azure support (#23)
Co-authored-by: mcalhoun <[email protected]>
1 parent 32e6868 commit cabb232

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+170359
-30140
lines changed

.eslintrc.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,3 @@
3737
]
3838
}
3939
}
40-
Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,43 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: ''
5-
labels: 'bug'
6-
assignees: ''
7-
4+
title: ""
5+
labels: "bug"
6+
assignees: ""
87
---
98

10-
Found a bug? Maybe our [Slack Community](https://slack.cloudposse.com) can help.
9+
Found a bug? Maybe our [Slack Community](https://slack.cloudposse.com) can help.
1110

1211
[![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)
1312

1413
## Describe the Bug
14+
1515
A clear and concise description of what the bug is.
1616

1717
## Expected Behavior
18+
1819
A clear and concise description of what you expected to happen.
1920

2021
## Steps to Reproduce
22+
2123
Steps to reproduce the behavior:
24+
2225
1. Go to '...'
2326
2. Run '....'
2427
3. Enter '....'
2528
4. See error
2629

2730
## Screenshots
31+
2832
If applicable, add screenshots or logs to help explain your problem.
2933

3034
## Environment (please complete the following information):
3135

3236
Anything that will help us triage the bug will help. Here are some ideas:
33-
- OS: [e.g. Linux, OSX, WSL, etc]
34-
- Version [e.g. 10.15]
37+
38+
- OS: [e.g. Linux, OSX, WSL, etc]
39+
- Version [e.g. 10.15]
3540

3641
## Additional Context
37-
Add any other context about the problem here.
42+
43+
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
blank_issues_enabled: false
22

33
contact_links:
4-
54
- name: Community Slack Team
65
url: https://cloudposse.com/slack/
76
about: |-
@@ -15,4 +14,4 @@ contact_links:
1514
- name: DevOps Accelerator Program
1615
url: https://cloudposse.com/accelerate/
1716
about: |-
18-
Own your infrastructure in record time. We build it. You drive it.
17+
Own your infrastructure in record time. We build it. You drive it.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
---
22
name: Feature Request
33
about: Suggest an idea for this project
4-
title: ''
5-
labels: 'feature request'
6-
assignees: ''
7-
4+
title: ""
5+
labels: "feature request"
6+
assignees: ""
87
---
98

10-
Have a question? Please checkout our [Slack Community](https://slack.cloudposse.com) or visit our [Slack Archive](https://archive.sweetops.com/).
9+
Have a question? Please checkout our [Slack Community](https://slack.cloudposse.com) or visit our [Slack Archive](https://archive.sweetops.com/).
1110

1211
[![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)
1312

1413
## Describe the Feature
1514

16-
A clear and concise description of what the bug is.
15+
A clear and concise description of what the bug is.
1716

1817
## Expected Behavior
1918

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
## what
2-
* Describe high-level what changed as a result of these commits (i.e. in plain-english, what do these changes mean?)
3-
* Use bullet points to be concise and to the point.
2+
3+
- Describe high-level what changed as a result of these commits (i.e. in plain-english, what do these changes mean?)
4+
- Use bullet points to be concise and to the point.
45

56
## why
6-
* Provide the justifications for the changes (e.g. business case).
7-
* Describe why these changes were made (e.g. why do these commits fix the problem?)
8-
* Use bullet points to be concise and to the point.
7+
8+
- Provide the justifications for the changes (e.g. business case).
9+
- Describe why these changes were made (e.g. why do these commits fix the problem?)
10+
- Use bullet points to be concise and to the point.
911

1012
## references
11-
* Link to any supporting github issues or helpful documentation to add some context (e.g. stackoverflow).
12-
* Use `closes #123`, if this PR closes a GitHub issue `#123`
1313

14+
- Link to any supporting github issues or helpful documentation to add some context (e.g. stackoverflow).
15+
- Use `closes #123`, if this PR closes a GitHub issue `#123`

.github/auto-release.yml

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
1-
name-template: 'v$RESOLVED_VERSION'
2-
tag-template: '$RESOLVED_VERSION'
3-
version-template: '$MAJOR.$MINOR.$PATCH'
1+
name-template: "v$RESOLVED_VERSION"
2+
tag-template: "$RESOLVED_VERSION"
3+
version-template: "$MAJOR.$MINOR.$PATCH"
44
version-resolver:
55
major:
66
labels:
7-
- 'major'
7+
- "major"
88
minor:
99
labels:
10-
- 'minor'
11-
- 'enhancement'
10+
- "minor"
11+
- "enhancement"
1212
patch:
1313
labels:
14-
- 'auto-update'
15-
- 'patch'
16-
- 'fix'
17-
- 'bugfix'
18-
- 'bug'
19-
- 'hotfix'
20-
default: 'minor'
14+
- "auto-update"
15+
- "patch"
16+
- "fix"
17+
- "bugfix"
18+
- "bug"
19+
- "hotfix"
20+
default: "minor"
2121

2222
categories:
23-
- title: '🚀 Enhancements'
24-
labels:
25-
- 'enhancement'
26-
- 'patch'
27-
- title: '🐛 Bug Fixes'
28-
labels:
29-
- 'fix'
30-
- 'bugfix'
31-
- 'bug'
32-
- 'hotfix'
33-
- title: '🤖 Automatic Updates'
34-
labels:
35-
- 'auto-update'
23+
- title: "🚀 Enhancements"
24+
labels:
25+
- "enhancement"
26+
- "patch"
27+
- title: "🐛 Bug Fixes"
28+
labels:
29+
- "fix"
30+
- "bugfix"
31+
- "bug"
32+
- "hotfix"
33+
- title: "🤖 Automatic Updates"
34+
labels:
35+
- "auto-update"
3636

3737
change-template: |
3838
<details>
@@ -45,9 +45,9 @@ template: |
4545
$CHANGES
4646
4747
replacers:
48-
# Remove irrelevant information from Renovate bot
49-
- search: '/(?<=---\s)\s*^#.*(Renovate configuration|Configuration)(?:.|\n)*?This PR has been generated .*/gm'
50-
replace: ''
51-
# Remove Renovate bot banner image
52-
- search: '/\[!\[[^\]]*Renovate\][^\]]*\](\([^)]*\))?\s*\n+/gm'
53-
replace: ''
48+
# Remove irrelevant information from Renovate bot
49+
- search: '/(?<=---\s)\s*^#.*(Renovate configuration|Configuration)(?:.|\n)*?This PR has been generated .*/gm'
50+
replace: ""
51+
# Remove Renovate bot banner image
52+
- search: '/\[!\[[^\]]*Renovate\][^\]]*\](\([^)]*\))?\s*\n+/gm'
53+
replace: ""

.github/workflows/build-and-test.yml

Lines changed: 99 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@ on:
1010

1111
env:
1212
AWS_REGION: us-east-2
13-
ATMOS_PLAN_DYNAMODB_TABLE: cptest-core-ue2-auto-gitops
13+
ATMOS_PLAN_DYNAMODB_TABLE: cptest-core-ue2-auto-gitops-plan-storage
14+
ATMOS_PLAN_COST_DYNAMODB_TABLE: cptest-core-ue2-auto-gitops-plan-cost-storage
1415
ATMOS_PLAN_S3_BUCKET: cptest-core-ue2-auto-gitops
16+
ATMOS_PLAN_BLOB_ACCOUNT_NAME: cptestcoreeusteststorage
17+
ATMOS_PLAN_BLOB_CONTAINER_NAME: github-action-terraform-plan-storage
18+
ATMOS_PLAN_COSMOS_CONTAINER_NAME: github-action-terraform-plan-storage
19+
ATMOS_PLAN_COSMOS_DATABASE_NAME: plans
20+
ATMOS_PLAN_COSMOS_ENDPOINT: "https://cptest-core-eus-test-cosmos.documents.azure.com:443/"
1521

1622
# Permissions required for assuming AWS identity
1723
permissions:
@@ -22,13 +28,15 @@ jobs:
2228
check-dist:
2329
name: "check-dist matches source"
2430
uses: cloudposse/github-actions-workflows/.github/workflows/ci-typescript-app-check-dist.yml@main
31+
with:
32+
node-version: 20.x
2533

2634
unit-test:
2735
name: "unit tests"
2836
runs-on: ubuntu-latest
2937
needs: check-dist
3038
steps:
31-
- uses: actions/checkout@v3
39+
- uses: actions/checkout@v4
3240
with:
3341
ref: ${{ github.event.pull_request.head.ref }}
3442
- uses: actions/setup-node@v3
@@ -40,22 +48,22 @@ jobs:
4048
- name: run unit tests
4149
run: yarn test
4250

43-
integration-test:
44-
name: "integration tests"
51+
integration-test-aws:
52+
name: "integration tests aws"
4553
runs-on: ubuntu-latest
4654
needs: check-dist
4755
steps:
48-
- uses: actions/checkout@v3
56+
- uses: actions/checkout@v4
4957
with:
5058
ref: ${{ github.event.pull_request.head.ref }}
5159

52-
- uses: actions/setup-node@v3
60+
- uses: actions/setup-node@v4
5361
with:
5462
node-version-file: package.json
5563
cache: yarn
5664

5765
- name: Configure AWS Credentials
58-
uses: aws-actions/configure-aws-credentials@v2
66+
uses: aws-actions/configure-aws-credentials@v4
5967
with:
6068
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }}
6169
aws-region: ${{ env.AWS_REGION }}
@@ -74,7 +82,7 @@ jobs:
7482
action: storePlan
7583
planPath: src/__fixtures__/mock.planfile
7684
component: demo
77-
stack: ue1-sandbox
85+
stack: ue2-auto
7886
tableName: ${{ env.ATMOS_PLAN_DYNAMODB_TABLE }}
7987
bucketName: ${{ env.ATMOS_PLAN_S3_BUCKET }}
8088
env:
@@ -84,18 +92,97 @@ jobs:
8492
id: get-plan
8593
with:
8694
action: getPlan
87-
planPath: ./test.planfile
95+
planPath: ./test-aws.planfile
8896
component: demo
89-
stack: ue1-sandbox
97+
stack: ue2-auto
9098
tableName: ${{ env.ATMOS_PLAN_DYNAMODB_TABLE }}
9199
bucketName: ${{ env.ATMOS_PLAN_S3_BUCKET }}
92100
env:
93101
GITHUB_TOKEN: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}
94102

95-
- name: Calculate SHA256 of planfile after retrieval
103+
- name: Calculate SHA256 of aws planfile after retrieval
104+
id: after-get-checksum
105+
run: |
106+
checksum=$(shasum -a 256 ./test-aws.planfile | cut -d ' ' -f 1)
107+
echo "$checksum"
108+
echo "checksum=$checksum" >>$GITHUB_OUTPUT
109+
110+
- name: Compare Before and After Checksums (AWS)
111+
run: |
112+
if [ "${{ steps.before-store-checksum.outputs.checksum }}" != "${{ steps.after-get-checksum.outputs.checksum }}" ]; then
113+
echo "Checksums do not match"
114+
exit 1
115+
fi
116+
117+
- name: Compare Before and After Checksums (AZURE)
118+
run: |
119+
if [ "${{ steps.before-store-checksum.outputs.checksum }}" != "${{ steps.after-get-checksum.outputs.checksum }}" ]; then
120+
echo "Checksums do not match"
121+
exit 1
122+
fi
123+
124+
integration-test-azure:
125+
name: "integration test azure"
126+
runs-on: ubuntu-latest
127+
needs: check-dist
128+
steps:
129+
- uses: actions/checkout@v4
130+
with:
131+
ref: ${{ github.event.pull_request.head.ref }}
132+
133+
- uses: actions/setup-node@v4
134+
with:
135+
node-version-file: package.json
136+
cache: yarn
137+
138+
- name: Configure Azure Credentials
139+
uses: azure/login@v1
140+
with:
141+
client-id: ${{ secrets.AZURE_CLIENT_ID }}
142+
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
143+
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
144+
145+
- name: Calculate SHA256 of planfile before storage
146+
id: before-store-checksum
147+
run: |
148+
checksum=$(shasum -a 256 src/__fixtures__/mock.planfile | cut -d ' ' -f 1)
149+
echo "$checksum"
150+
echo "checksum=$checksum" >>$GITHUB_OUTPUT
151+
152+
- uses: ./
153+
id: store-plan
154+
with:
155+
blobAccountName: ${{ env.ATMOS_PLAN_BLOB_ACCOUNT_NAME }}
156+
blobContainerName: ${{ env.ATMOS_PLAN_BLOB_CONTAINER_NAME }}
157+
metadataRepositoryType: cosmos
158+
planRepositoryType: azureblob
159+
cosmosContainerName: ${{ env.ATMOS_PLAN_COSMOS_CONTAINER_NAME }}
160+
cosmosDatabaseName: ${{ env.ATMOS_PLAN_COSMOS_DATABASE_NAME }}
161+
cosmosEndpoint: ${{ env.ATMOS_PLAN_COSMOS_ENDPOINT }}
162+
action: storePlan
163+
planPath: src/__fixtures__/mock.planfile
164+
component: demo
165+
stack: eus-demo
166+
167+
- uses: ./
168+
id: get-plan
169+
with:
170+
blobAccountName: ${{ env.ATMOS_PLAN_BLOB_ACCOUNT_NAME }}
171+
blobContainerName: ${{ env.ATMOS_PLAN_BLOB_CONTAINER_NAME }}
172+
metadataRepositoryType: cosmos
173+
planRepositoryType: azureblob
174+
cosmosContainerName: ${{ env.ATMOS_PLAN_COSMOS_CONTAINER_NAME }}
175+
cosmosDatabaseName: ${{ env.ATMOS_PLAN_COSMOS_DATABASE_NAME }}
176+
cosmosEndpoint: ${{ env.ATMOS_PLAN_COSMOS_ENDPOINT }}
177+
action: getPlan
178+
planPath: ./test-azure.planfile
179+
component: demo
180+
stack: eus-demo
181+
182+
- name: Calculate SHA256 of aws planfile after retrieval
96183
id: after-get-checksum
97184
run: |
98-
checksum=$(shasum -a 256 ./test.planfile | cut -d ' ' -f 1)
185+
checksum=$(shasum -a 256 ./test-azure.planfile | cut -d ' ' -f 1)
99186
echo "$checksum"
100187
echo "checksum=$checksum" >>$GITHUB_OUTPUT
101188

0 commit comments

Comments
 (0)