Skip to content

Commit

Permalink
Merge pull request #115 from Enterprise-CMCS/val
Browse files Browse the repository at this point in the history
Release to production
  • Loading branch information
mdial89f authored Feb 27, 2024
2 parents 83e9440 + b022672 commit 7bfb423
Show file tree
Hide file tree
Showing 42 changed files with 4,577 additions and 299 deletions.
80 changes: 0 additions & 80 deletions .github/workflows/codeql.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/dependency-review.yml

This file was deleted.

68 changes: 0 additions & 68 deletions .github/workflows/dependency-update.yml

This file was deleted.

14 changes: 7 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ on:
- "!skipci*"

concurrency:
group: ${{ github.ref_name }}-group
group: ${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}-group

env:
STAGE_NAME: ${{ github.ref_name }}
STAGE_NAME: ${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}

permissions:
id-token: write
Expand All @@ -33,7 +33,7 @@ jobs:
needs:
- init
environment:
name: ${{ github.ref_name }}
name: ${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -55,7 +55,7 @@ jobs:
needs:
- deploy
environment:
name: ${{ github.ref_name }}
name: ${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -77,7 +77,7 @@ jobs:
needs:
- deploy
environment:
name: ${{ github.ref_name }}
name: ${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
needs:
- deploy
environment:
name: ${{ github.ref_name }}
name: ${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
- name: Archive stage resources
uses: actions/upload-artifact@v3
with:
name: aws-resources-${{ github.ref_name }}
name: aws-resources-${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}
path: resources/aws-resources.json

release:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/destroy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ jobs:
)
runs-on: ubuntu-20.04
environment:
name: ${{ inputs.environment || github.event.ref }}
name: ${{ inputs.environment || (startsWith(github.event.ref, 'snyk-') && 'snyk' || github.event.ref) }}
env:
STAGE_NAME: ${{ inputs.environment || github.event.ref }}
STAGE_NAME: ${{ inputs.environment || (startsWith(github.event.ref, 'snyk-') && 'snyk' || github.event.ref) }}
permissions:
id-token: write
contents: read
Expand Down Expand Up @@ -61,5 +61,5 @@ jobs:
- uses: strumwolf/delete-deployment-environment@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: ${{ inputs.environment || github.event.ref }}
environment: ${{ inputs.environment || (startsWith(github.event.ref, 'snyk-') && 'snyk' || github.event.ref) }}
onlyRemoveDeployments: true
53 changes: 53 additions & 0 deletions .github/workflows/security-group-cleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Security Group Cleanup

on:
schedule:
- cron: "0 2 * * *"
workflow_dispatch:

jobs:
security-group-cleanup:
name: Security Group Cleanup
runs-on: ubuntu-20.04

permissions:
id-token: write
contents: read

steps:
- name: Checkout
uses: actions/checkout@v3

- uses: ./.github/actions/setup # We need this largely for the PROJECT variable setting

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ secrets.AWS_OIDC_ROLE_TO_ASSUME }}
aws-region: us-east-1
role-duration-seconds: 10800

- name: Clean Up Unassigned Security Groups
id: runningStages
run: |
# Step 1, get a list of all security groups attached to ENIs
inusesgs=(`aws ec2 describe-network-interfaces \
--query "NetworkInterfaces[].Groups[].GroupId" \
--output text`)
# Step 2, get a list of all security groups owned by our project.
allsgs=(`aws ec2 describe-security-groups \
--filters Name=tag:PROJECT,Values="$PROJECT" \
--query "SecurityGroups[].GroupId" \
--output text`)
# Step 3, delete any security group owned by our project that's not attached to an ENI
for i in "${allsgs[@]}"
do
if [[ " ${inusesgs[*]} " =~ " ${i} " ]]; then
echo "Keping $i as it is in use"
else
echo "Deleting $i as it is not in use..."
aws ec2 delete-security-group --group-id $i
fi
done
2 changes: 1 addition & 1 deletion .github/workflows/workspace-setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: "0 10 * * SUN"

concurrency:
group: ${{ github.ref_name }}-test-ws-setup
group: ${{ startsWith(github.ref_name, 'snyk-') && 'snyk' || github.ref_name }}-test-ws-setup

jobs:
test:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<a href="https://codeclimate.com/github/Enterprise-CMCS/seatool-connectors/maintainability">
<img src="https://api.codeclimate.com/v1/badges/d23421cdd24aea696605/maintainability" />
</a>
<a href="https://dependabot.com/">
<img alt="Dependabot" src="https://badgen.net/badge/Dependabot/enabled/green?icon=dependabot">
<a href="https://snyk.io/">
<img alt="Snyk" src="https://img.shields.io/badge/Snyk-protected-purple">
</a>
<a href="https://github.com/prettier/prettier">
<img alt="code style: prettier" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square">
Expand Down
2 changes: 1 addition & 1 deletion docs/_deploy-metrics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"react-dom": "18.2.0",
"react-icons": "^4.8.0",
"react-json-to-csv": "^1.2.0",
"recharts": "^2.2.0"
"recharts": "^2.11.0"
},
"devDependencies": {
"@types/node": "18.11.0",
Expand Down
Loading

0 comments on commit 7bfb423

Please sign in to comment.