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

A Bundle of Docker Deploy Improvements #676

Merged
merged 12 commits into from
Nov 27, 2023
Merged

Conversation

AlpacaFur
Copy link
Member

@AlpacaFur AlpacaFur commented Nov 25, 2023

Description

This PR accomplishes a few things (I probably should have broken it up a bit more in retrospect):

1. Improves the docker deploy scripts (the actual original point of this branch).

  • Added get-ecr-image-name.sh to generate a standalone docker image tag.
  • Added frontend:build, frontend:run, frontend:push, backend:build, backend:run, backend:push, and ecr:docker:auth scripts to the package.json to simplify manual deploys.
  • Added a README for deploying to staging or prod in the infrastructure/prod folder.

2. Adds metadata to our built docker images (images now store their commit message, commit hash and build time)

  • The data for both frontend and backend is visible on the frontend, and the backend data is also available on a new /api/meta/info endpoint.
Screenshot 2023-11-24 at 7 57 39 PM image

3. Finishes backend setup for the frontend Vercel migration (cookies are evil).

  • Update the cors allowed methods, domain, and allowed credentials (true).

Type of change

Please tick the boxes that best match your changes.

  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  1. I manually tested the new deploy scripts to ensure they worked properly.
  2. I tested the metadata worked locally (frontend only) and in staging (frontend and backend).
  3. I tested that with the change you can login on frontend-staging.graduatenu.com.

Checklist:

  • I have run the production builds in docker for the frontend/backend and ensure things run fine. Check README of repo on how to run if not sure.
  • I have performed a self-review of my own code
  • I have commented my code where needed
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I've run the end to end tests
  • Any dependent changes have been merged and published in downstream modules

Copy link

vercel bot commented Nov 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
graduatenu-frontend-v2 ❌ Failed (Inspect) Nov 27, 2023 2:55am

Copy link
Contributor

@lukejianu lukejianu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall very based LFT PR.

infrastructure/prod/get-ecr-image-name.sh Outdated Show resolved Hide resolved
packages/common/src/types.ts Show resolved Hide resolved
packages/api-v2/src/main.ts Show resolved Hide resolved
packages/api-v2/src/auth/auth.controller.ts Outdated Show resolved Hide resolved
@AlpacaFur AlpacaFur merged commit 67c3f3a into main Nov 27, 2023
5 checks passed
@AlpacaFur AlpacaFur deleted the luke/docker-deploy-improvements branch November 27, 2023 03:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants