Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add final workflows #46

Merged
merged 2 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/changeset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
environment: [test, Dev]
environment: [Dev, test]
environment: ${{ matrix.environment }}
permissions:
id-token: write
Expand Down Expand Up @@ -49,7 +49,7 @@ jobs:
npm run cdk diff -- OpenSearch-CI-Config-${{ matrix.environment }} -c useSsl=false -c serverAccessType=prefixList -c restrictServerAccessTo=${{ secrets.PREFIX_LIST }} | sed -E 's/[0-9]{12}/[MASKED]/g' >> $GITHUB_OUTPUT

echo "" >> $GITHUB_OUTPUT
echo "## CI-Dev Stack ChangeSet" >> $GITHUB_OUTPUT
echo "## CI-Dev Stack ChangeSet ${{ matrix.environment }}" >> $GITHUB_OUTPUT
npm run cdk diff -- OpenSearch-CI-${{ matrix.environment }} -c useSsl=true -c authType=github -c dataRetention=true -c macAgent=true -c useProdAgents=true -c enableViews=true -c ignoreResourcesFailures=false -c serverAccessType=prefixList -c restrictServerAccessTo=${{secrets.PREFIX_LIST}} | sed -E 's/[0-9]{12}/[MASKED]/g' >> $GITHUB_OUTPUT

echo "EOF" >> $GITHUB_OUTPUT
Expand All @@ -68,5 +68,5 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `<details>\n<summary>Stack Changeset Details</summary>\n\n\`\`\`\n${maskedOutput}\n\`\`\`\n</details>`
body: `<details>\n<summary>Stack Changeset Details ${{ matrix.environment }} </summary>\n\n\`\`\`\n${maskedOutput}\n\`\`\`\n</details>`
})
22 changes: 15 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
deployment:
name: Deploy to Prod Environment
name: Deploy Environment
strategy:
fail-fast: true
matrix:
Expand Down Expand Up @@ -39,16 +39,24 @@ jobs:
npm run build

- name: Install AWS CDK
run: npm install -g [email protected]

- name: Deploy
run: |
npm install -g [email protected]
cdk acknowledge 30717

- name: Deploy CI-Config Stack
run: |
npm run cdk deploy -- OpenSearch-CI-Config-${{ matrix.environment }} -c useSsl=false -c serverAccessType=prefixList -c restrictServerAccessTo=${{secrets.PREFIX_LIST}} | sed -E 's/[0-9]{12}/[MASKED]/g'
npm run cdk deploy -- OpenSearch-CI-${{ matrix.environment }} -c useSsl=true -c authType=oidc -c dataRetention=true -c macAgent=true -c useProdAgents=true -c enableViews=true -c ignoreResourcesFailures=false -c serverAccessType=prefixList -c restrictServerAccessTo=${{secrets.PREFIX_LIST}} --require-approval never | sed -E 's/[0-9]{12}/[MASKED]/g'
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "Deployment failed"
exit 1
fi

- name: Check for Deployment Failure (sed)
- name: Deploy CI StacK
run: |
if sed -n '/Deployment failed:/p' deployment_logs.txt; then
npm run cdk deploy -- OpenSearch-CI-${{ matrix.environment }} -c useSsl=false -c authType=oidc -c dataRetention=true -c macAgent=true -c useProdAgents=true -c enableViews=true -c ignoreResourcesFailures=false -c serverAccessType=prefixList -c restrictServerAccessTo=${{secrets.PREFIX_LIST}} --require-approval never | sed -E 's/[0-9]{12}/[MASKED]/g'
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "Deployment failed"
exit 1
fi