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

feat: pre-release candidate #61

Closed
wants to merge 85 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
89ab6fc
refactor: clean up ant-stack core a bit
ap0nia Jul 10, 2023
8ab6548
feat: dedicated ci/cd cli command
ap0nia Jul 10, 2023
04c63fc
refactor: restructured github workflows directories
ap0nia Jul 10, 2023
c884d47
fix: bruh moment https://github.com/orgs/community/discussions/18055
ap0nia Jul 10, 2023
ae09aae
fix: try using keys in header
ap0nia Jul 10, 2023
b6cd790
fix: try again to fix yaml
ap0nia Jul 10, 2023
e054abd
fix: i give up with description
ap0nia Jul 10, 2023
eb55ad0
fix: why is environment url not showing up
ap0nia Jul 10, 2023
33fd768
feat: add more logging
ap0nia Jul 10, 2023
611c4eb
fix: invalid environment url
ap0nia Jul 10, 2023
f4f8010
feat: try to add metadata to deployment
ap0nia Jul 10, 2023
77a1d8f
feat: custom environment for docs and api
ap0nia Jul 11, 2023
870700d
feat: wait for cloudformation updates
ap0nia Jul 11, 2023
da96246
feat: added destroy command and workflow
ap0nia Jul 11, 2023
b9dfdc6
fix: call the correct wait command
ap0nia Jul 11, 2023
d2317e2
feat(ant-stack): correctly wait for cfn stacks
ecxyzzy Jul 11, 2023
351d8e6
chore: remove cicd.ts
ecxyzzy Jul 11, 2023
8854170
chore: nuke libs/ddb
ecxyzzy Jul 11, 2023
04254c0
fix: wrap stabilizeStack logic in try-catch
ecxyzzy Jul 11, 2023
05f2f2e
chore: add e? idk why it's not catching
ecxyzzy Jul 11, 2023
b2419a4
chore: bleh [skip ci]
ecxyzzy Jul 11, 2023
f002cde
feat: test non-sync child spawn & output piping
ecxyzzy Jul 11, 2023
a6f931c
fix: decode the buffers from child process
ecxyzzy Jul 11, 2023
935f1a4
refactor: cleaned up deploy file
ap0nia Jul 11, 2023
fd3b383
feat: statically analyze the built files
ap0nia Jul 11, 2023
a80a4dc
feat: more robust build system
ap0nia Jul 11, 2023
7fce673
feat: making progress with overhauling config load
ap0nia Jul 11, 2023
d4a67f0
feat: progress on custom construct config
ap0nia Jul 12, 2023
f5e4180
feat: maybe some progress
ap0nia Jul 12, 2023
e91dbc8
feat: construct config works
ap0nia Jul 13, 2023
1aabbe0
feat: ok time for RFC because i'm tired
ap0nia Jul 13, 2023
96193e9
feat: demo of settings override
ap0nia Jul 13, 2023
bc8dbf3
fix: deep partial
ap0nia Jul 13, 2023
603d9de
refactor: cleaned up comments, refactored config
ap0nia Jul 14, 2023
a3a21ca
feat: almost sane config loading
ap0nia Jul 14, 2023
3789fe6
feat: i think it's ready
ap0nia Jul 14, 2023
c9e75a0
feat: finally something works
ap0nia Jul 14, 2023
6400af2
fix: typescript issues
ap0nia Jul 14, 2023
8a2e517
refactor: use package json name
ap0nia Jul 14, 2023
cebb127
fix: remove extraneous packages
ap0nia Jul 14, 2023
8fdfa11
refactor: create new file for wait-for-stack-idle
ecxyzzy Jul 14, 2023
a89d436
fix: add emoji to ant-stack destroy
ecxyzzy Jul 14, 2023
9c8c036
feat: moved build and dev to api construct
ap0nia Jul 15, 2023
7560584
Merge branch 'cdk-cicd' of github.com:icssc/peterportal-api-next into…
ap0nia Jul 15, 2023
1b6b1dc
feat: adjusted config stuff
ap0nia Jul 15, 2023
927127b
refactor: cleaned up static analysis file
ap0nia Jul 15, 2023
f12cb24
fix: bad import path
ap0nia Jul 15, 2023
04598bb
refactor: cleaned up api construct
ap0nia Jul 15, 2023
ce95f49
refactor: minimal api construct
ap0nia Jul 15, 2023
1fdaef0
feat: construct detection and specific commands
ap0nia Jul 15, 2023
be3fe63
feat: github construct for actions ci/cd
ap0nia Jul 15, 2023
8c48137
chore: separate gitignores
ap0nia Jul 15, 2023
f76254e
feat: programmatic cli
ap0nia Jul 15, 2023
032b985
feat: github construct handles outputs
ap0nia Jul 15, 2023
f3563c8
refactor: remove bad aws code
ap0nia Jul 15, 2023
9a0d3f8
feat: basic github mvp
ap0nia Jul 15, 2023
9ca912f
chore: restored config
ap0nia Jul 15, 2023
24ebadd
feat: ok, time to test deploy!
ap0nia Jul 15, 2023
f88ea28
chore: disable cdk deploy for now
ap0nia Jul 15, 2023
7b1468e
fix: manually invoke synth during ci/cdfix: manually invoke synth during
ap0nia Jul 15, 2023
aac289e
fix: synth app properly
ap0nia Jul 15, 2023
7fb2a0f
fix: hopefully this does something
ap0nia Jul 15, 2023
fd24376
fix: lambda handler path
ap0nia Jul 15, 2023
9f3491a
fix: banner only once
ap0nia Jul 15, 2023
c3957b9
feat: github ci/cd hooks
ap0nia Jul 15, 2023
1ca9c2d
fix: try forwarding env
ap0nia Jul 15, 2023
c4b3b95
fix: import wildcard and inherit stdio
ap0nia Jul 15, 2023
e296f98
chore: debug output json
ap0nia Jul 15, 2023
e5e03c7
chore: debug cfn outputs
ap0nia Jul 15, 2023
817a0c7
chore: clean up github construct
ap0nia Jul 15, 2023
ee13875
chore: fix file casing
ap0nia Jul 16, 2023
b6ad04f
fix: wrong import paths
ap0nia Jul 16, 2023
3a159d5
feat: separate github stack with outputs
ap0nia Jul 16, 2023
2e22aa2
fix: find all stacks with github
ap0nia Jul 16, 2023
889d70f
feat: static site wip
ap0nia Jul 16, 2023
0dfd7fb
refactor: trimmed static site
ap0nia Jul 16, 2023
93625d0
feat: construct prop overrides
ap0nia Jul 16, 2023
8beb5a4
feat: let's try static site!
ap0nia Jul 16, 2023
29ee9f2
fix: only allocate resources during cdk
ap0nia Jul 16, 2023
8811bbf
fix: try again
ap0nia Jul 16, 2023
9ed3722
fix: cross stack reference with same environment
ap0nia Jul 16, 2023
378b650
chore: bruh moment
ap0nia Jul 16, 2023
331a901
feat: it works!
ap0nia Jul 16, 2023
318863b
feat: re - file naming convention
ap0nia Jul 16, 2023
f86e490
fix: type issues
ap0nia Jul 16, 2023
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
59 changes: 0 additions & 59 deletions .github/actions/stabilize-stack/action.yml

This file was deleted.

75 changes: 0 additions & 75 deletions .github/workflows/cleanup-pr.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,33 +1,41 @@
---
name: Deploy PR to staging

on:
pull_request:
types:
- opened
- synchronize
- unlabeled

permissions:
id-token: write
contents: read
deployments: write
pull-requests: write

concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true

jobs:
deploy:
if: (!contains(github.event.pull_request.labels.*.name, 'no deploy'))

runs-on: ubuntu-latest

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUM: ${{ github.event.pull_request.number }}
NODE_ENV: staging

ACCOUNT_ID: ${{ secrets.ACCOUNT_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_REGION: us-east-1
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1

CERTIFICATE_ARN: ${{ secrets.CERTIFICATE_ARN }}
DATABASE_URL: ${{ secrets.DATABASE_URL_STAGING }}
HOSTED_ZONE_ID: ${{ secrets.HOSTED_ZONE_ID }}
NODE_ENV: staging
PR_NUM: ${{ github.event.pull_request.number }}

steps:
- name: Check out codebase
Expand Down Expand Up @@ -57,30 +65,5 @@ jobs:
- name: Build assets
run: pnpm build

- name: Wait for API stack to stabilize
uses: ./.github/actions/stabilize-stack
with:
stack_name: peterportal-api-next-staging-${{ github.event.pull_request.number }}
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRETS_ACCESS_KEY }}

- name: Wait for docs stack to stabilize
uses: ./.github/actions/stabilize-stack
with:
stack_name: peterportal-api-next-docs-staging-${{ github.event.pull_request.number }}
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws_secret_access_key: ${{ secrets.AWS_SECRETS_ACCESS_KEY }}

- name: Deploy stacks
run: pnpm run deploy --filter="ant-stack" --filter="docs-cdk"

- name: Comment staging URLs
uses: marocchino/sticky-pull-request-comment@v2
with:
header: stagingURL
recreate: true
message: 🚀 Staging instances deployed!

API - https://staging-${{ github.event.pull_request.number }}.api-next.peterportal.org

Docs - https://staging-${{ github.event.pull_request.number }}-docs.api-next.peterportal.org
run: pnpm ant-stack deploy
68 changes: 68 additions & 0 deletions .github/workflows/destroy-staging-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Deploy PR to staging

on:
pull_request:
types:
- closed
- labeled

permissions:
id-token: write
contents: read
deployments: write
pull-requests: write

concurrency:
group: ${{ github.head_ref }}
cancel-in-progress: true

jobs:
deploy:
if: (!contains(github.event.pull_request.labels.*.name, 'no deploy'))

runs-on: ubuntu-latest

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUM: ${{ github.event.pull_request.number }}
NODE_ENV: staging

ACCOUNT_ID: ${{ secrets.ACCOUNT_ID }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: us-east-1

CERTIFICATE_ARN: ${{ secrets.CERTIFICATE_ARN }}
DATABASE_URL: ${{ secrets.DATABASE_URL_STAGING }}
HOSTED_ZONE_ID: ${{ secrets.HOSTED_ZONE_ID }}

steps:
- name: Check out codebase
uses: actions/checkout@v3

- name: Set up Node.js environment
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
with:
version: 8
run_install: false

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Build AntStack
run: pnpm build --filter="ant-stack"

- name: Install dependencies (again)
run: pnpm install --frozen-lockfile

- name: Build assets
run: pnpm build

- name: Deploy stacks
run: pnpm ant-stack destroy
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Sync labels

on:
push:
branches:
- main
paths:
- .github/labels.yml

jobs:
build:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Lint PR title and message

on:
pull_request_target:

jobs:
lint-pr:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Check for TypeScript errors

on:
pull_request:

jobs:
check-typescript:
runs-on: ubuntu-latest
Expand Down
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,3 @@ tools/grades-updater/outputData

# grades-updater logs
tools/grades-updater/logs

# docusaurus
.docusaurus
build/
Loading