Bonus Assignment for Midterm Exam of Spring 2025 DevOps Class
1. Tech Stack Used : Git Action, npm[Semantic Release], maven, react, springboot, docker, AWS[EC2, RDS, Route53, ECR]
2. Repository :
-Source repo : contains FrontEnd and BackEnd Code. Added release.yml so it could do tagging with Semantic Release.
-Infra repo : contains Git Action Workflow scripts. I added “Promotion.yml” script so triggered script could pull latest docker image and deploy it on RC server.
3. Work Flow :
-source repo has a workflow that releases tag in commits by semantic release
-once the release tag is created, it will kick off a promotion workflow in the infra repo
-workflow in infra repo(promotion.yml) will pull docker image and run it on pre-installed EC2
-pre-installed EC2 will contain SSL and it has domain name "myapp-rc.domain.com"
4. Implementation Details :
4.1 Write release.yml(Git Action workflow file) in source code. :
Only commits that abide certain rules will trigger semantic release. Also we need to set up Node.js to install semantic release here. BackEnd is made with Java and Maven. Also added “.releaserc.json” and “prepare-release.sh” file to support it.
4.2 Write workflow in infra repo : release.yml file will trigger another workflow script in infra repo. Newly tagged commit will trigger this workflow to pull latest docker image and deploy it on pre-installed EC2.
This script will pull latest docker image and tag it and then deploy it.
4.3 Pre-installed EC2 will contain SSL and it has domain name "myapp-rc.domain.com" : Pre-installed ec2 will contain SSL. I added related codes in nginx.conf in front-end code so it could find keys.
Also through Route53, I linked the domain myapp-rc.domain.com to the ec2. Therefore after the build was finished I could access it by “https://myapp-rc.jakekwon.hair/”
5. Challenges and lessons learned : Installing semantic release was tricky and I could find a github repo(link) that explained how to implement it to Java/Maven project. Other than that, giving proper permissions(e.g. Docker Socket) and Credentials(AWS credentials, Github Credentials) was important to run scripts. Plus, Java Version and node version caused error so I upgraded them.
6. Assumptions made (Scenario) :
-Source Repo has the souce code of the project
-Through Nightly-build(in infra-repo) the project is built and the image is stored in repository(ECR).
-ECR image is deployed to QA Server so it can be tested.
-Another Semantic Tag script in source code triggers deployment of RC Server. It is made from image in ECR which means it has passed smoke test.
-video demo (link)
Comments
Post a Comment