Pomodoro Music player Tested on Chrome - Desktop/Laptop - may not work properly on other browsers and mobile platforms
- Clone source code
git clone https://{{username}}:{{access_token}}@github.com/anhminhbo/BITS-Pomodoro-Music.git
- Make sure your computer install docker and docker-compose or else:
-
Uninstall old docker or docker-compose
- Go to Control panel
- Choose Uninstall a program
- Select Docker and uninstall
-
Install WSL2 Linux kernel update and Ubuntu via https://learn.microsoft.com/en-us/windows/wsl/install-manual#step-4---download-the-linux-kernel-update-package
-
Install Docker Desktop(Docker-compose is included in Docker Desktop) via https://docs.docker.com/desktop/install/windows-install/
-
Run Ubuntu installed in previous instruction
- Make an account (password is invisible so be careful)
- Close Ubuntu
-
Run code below in terminal to check if Docker install correctly or not
docker -v
docker-compose -v
- Congrats you are done, if there are any bugs or errors please contact Mr Bug Fix Wanderer/anhminhbo <3
- Uninstall old docker or docker-compose
sudo apt-get remove docker docker-engine docker.io containerd runc
- Install docker and docker-compose
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
- Checking docker and docker-compose version
docker -v
docker-compose -v
- Make sure you are using a bash terminal to run the following code
bash -x local_startup.sh
bash -x local_startup.sh backend
- Make sure you are using a bash terminal to run the following code
bash -x clean-up.sh
- Testing docker local env on your local machine
bash -x testing_docker_prod.sh
- Make sure you are using a bash terminal to run the following code
- First arg is the name of the branch you want to merge, Second arg is your commit message for your current branch
- For all frontend members
bash push_current_and_merge.sh mirror ""
- Only frontend teamleader
bash push_current_and_merge.sh minh-dev ""
- Only project leader
bash push_current_and_merge.sh main ""
- Whenever a dev using the push_current_and_merge.sh script, it will automatically trigger Github action to create a PR to mirror(Master Frontend Leader)
- Whenever mirrorusing the push_current_and_merge.sh script, it will automatically trigger Github action to create a PR to minh-dev(Team Leader)
- Whenever minh-dev has new codes, github action trigger to create a new PR to main for review
- (New) Add new github action to automated build and push Docker image instead of old costly Jenkins
- (New) Add new github action to deploy production after build and push Docker images success
- After main branch has new codes, it trigger Jenkins pipeline on Jenkins VM to automate build, push and deploy to production.
- Prerequisites
- Install ansible
- Install terraform
- MacOs or Linux platform or Window Bash env
- Register and buy a domain(Namecheap, GoDaddy, or any domain providers)
- Install AWS CLI and configure AWS CLI using
aws configure
- Execute build infra script to provision AWS infra for the app, remember to get a domain first
bash provisioners/build_infra.sh your_domain_here your_frontend_port your_backend_port
Notes: Sometimes the script will stop at Config the VM and not proceed to Apply cert for the web app step. IF you do not see "Done building infrastructure of your web app. Ref: BugFixWanderer", Here how to solve it, type in console in provisioners folder: ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -u ubuntu --key-file aws-ec2-private-key.pem -T 1000 -i ansible_hosts ansible.apply_cert.yaml
-
Remember to read and type "yes" ^^!
-
There will be an interval of 5s to check if you have point your newly domain to the App VM IP or not, please be patient because it takes 0-72h to change globally even if you do correctly, you can manually check by using this command at the meantime when waiting:
nslookup your_domain_here | grep Address | tail -n 1 | cut -d" " -f2
- If any errors happened, script automatically destroys all the resources to start over, or you can do it manually:
bash provisioners/destroy_infra.sh
- For troubleshooting produciton env, here how to ssh to production:
ssh -vv ubuntu@your_ec2_ip -i provisioners/aws-ec2-private-key.pem