Group 1 CMPE 451 2024 Fall Final Release
Final Release
Deployment
We use DigitalOcean's App Platform with the DigitalOcean Container Registry. We have a single registry that all images are pulled from. The app platform will automatically deploy the latest image from the registry when a push happens.
The deployment process is very simple. When following the sets, if two sets of commands are given, execute only the commands for the environment you're deploying to:
Prerequisites
Make sure your DigitalOcean CLI has been set up and you have logged in (doctl auth init
).
Authorize with the registry (only need to do once):
doctl registry login
Deploying the Application
Important
Note that you need to use docker compose
and NOT docker-compose
. Dashed version is the older version that uses Python and may have conflicts with your local Python environment. We also don't provide version
which may cause an error with the old Compose V1. For more details, please check the Docker documentation.
When you're going to deploy only the application (no changes to infrastructre), you can follow the steps below:
- Build images using the docker compose setup.
docker compose build
- Tag images for the registry.
# for prod
docker tag bounswe2024group1-451-web:latest registry.digitalocean.com/programming-languages-2/web:latest
docker tag bounswe2024group1-451-backend:latest registry.digitalocean.com/programming-languages-2/backend:latest
# for staging
docker tag bounswe2024group1-451-web:latest registry.digitalocean.com/programming-languages-2/web:staging
docker tag bounswe2024group1-451-backend:latest registry.digitalocean.com/programming-languages-2/backend:staging
- Push images to the registry.
# for prod
docker push registry.digitalocean.com/programming-languages-2/web:latest
docker push registry.digitalocean.com/programming-languages-2/backend:latest
# for staging
docker push registry.digitalocean.com/programming-languages-2/web:staging
docker push registry.digitalocean.com/programming-languages-2/backend:staging
This will trigger a deployment on the DigitalOcean backend.
- Make sure your deployment is successful by checking the logs.
Deploying the Infrastructure
GUI Changes
When you have made changes to the infrastructure, make sure you keep .do/app-{env}.yml
up to date. If you've used the GUI, pull spec changes using doctl
:
# for prod
doctl apps spec get <app-id> > .do/app-prod.yml
# for staging
doctl apps spec get <app-id> > .do/app-staging.yml
To get <app-id>
you can use doctl apps list
and find the app id for the environment you're deploying to.
App Spec Changes
When you've changed the app spec, you can use doctl apps update
to update the app. Make sure you've updated the spec file before running the command.
# for prod
doctl apps update --spec .do/app-prod.yml
# for staging
doctl apps update --spec .do/app-staging.yml
It is paramount that staging and prod are kept in sync. If you've made changes to the staging environment, make sure to update the prod environment as well.
What's Changed
- [Lab] Lab 8 by @mmtftr in #582
- Bugfix for questionCount. by @EnesBaserr in #597
- Get Questions and Answers for UserProfile by @EnesBaserr in #599
- [Frontend] Implement Code Block Popover by @mmtftr in #613
- [Frontend] Add difficulty filter to Tag Page by @mmtftr in #612
- [Frontend] Implement Question search by @mmtftr in #615
- [Frontend] Add Difficulty Level in Question Card by @mmtftr in #618
- [Devops] Add Frontend type checking to CI by @mmtftr in #616
- [Backend] Fix question DTO field by @mmtftr in #620
- [Frontend] Implement Difficulty Filter in the Question Search Page by @mmtftr in #621
- [Deploy] Deploy to Production by @mmtftr in #623
- Fix code exec. response by @EnesBaserr in #625
- Fix question related endpoints to retrieve difficulty level. by @EnesBaserr in #626
- Add followed tags to users' profile responses. by @EnesBaserr in #628
- Add Code Snippets to Question by @NazireAta in #632
- Add preview to question by @NazireAta in #634
- [BE] Feature/630 get bookmarked questions by @atakanyasar in #635
- Add rating for level of difficulty of a question by @EnesBaserr in #637
- [BE] Fix/638-bookmark by @atakanyasar in #639
- [Mobile] Bookmarked Questions Page and Bookmark Button on Questions by @atakanyasar in #640
- Implemented reputationPoints flow. by @EnesBaserr in #643
- Add Difficulty Rating to Questions by @NazireAta in #645
- [Frontend] Followed tags in profile by @mmtftr in #646
- [Deploy] Deploy to main by @mmtftr in #647
- Fix Accessibility Issues by @NazireAta in #648
- Lab-9 PR by @EnesBaserr in #654
- [Mobile] Home Page by @atakanyasar in #659
- [Mobile] Design Question Card by @atakanyasar in #664
- [Mobile] Filter Questions By Difficulty by @atakanyasar in #665
- [DevOps] Migrate DigitalOcean account by @mmtftr in #670
- [Deploy] Test deploy by @mmtftr in #671
- [FE] Implement Tag and Question References for Answer Creation by @asligook in #624
- [FE] Display Author Field in the Tag Page by @asligook in #669
- [Frontend] Folow/Unfollow Tags by @ozdentarikcan in #672
- [Frontend] Show Execution Time by @ozdentarikcan in #673
- [Frontend] Implement Bookmark button by @ozdentarikcan in #674
- fix(backend): fix incompatible question type returned from TagDetails by @mmtftr in #676
- Implement Question Edit by @NazireAta in #675
- [Backend] Fix Self Following Field in Tag Details by @mmtftr in #677
- [Deploy] Test deploy by @mmtftr in #678
- Added default profile picture by @NazireAta in #680
- Frontend/feature/fix tag badge routing by @NazireAta in #688
- [Backend] Fix follower count in Tags by @mmtftr in #682
- [Frontend] Implement Bookmark Page by @ozdentarikcan in #684
- [Mobile] Follow/Unfollow Tag by @atakanyasar in #668
- [Frontend] Show reputation points in profile page by @ozdentarikcan in #686
- 627 [BACKEND] GET users/{userid} should return answers, questions, and followed tags for that user by @Cgtycolak in #685
- [FE] Implement Glossary Page and Tag Type Pages by @asligook in #694
- [Frontend] Fix Bookmarks Page by @mmtftr in #696
- [Backend] Sort Questions by Followed Users by @ozdentarikcan in #691
- [Mobile] Profile Page by @atakanyasar in #695
- [Frontend] Use sr-only text by @ozdentarikcan in #692
- [Frontend] Add loading screen to TagType Page by @ozdentarikcan in #697
- [Frontend] Implement some UX improvements by @mmtftr in #698
- [Deploy] Test deploy by @mmtftr in #699
- [Mobile] Sort Recommended Order by @atakanyasar in #701
- [Hotfix] Fix some backend/frontend bugs by @mmtftr in #703
- Enhance New Question and New Answer Screens by @atakanyasar in #705
- Develop to Main by @atakanyasar in #702
Full Changelog: customer-milestone-2...customer-presentation-3