CI/CD is useful for deploying your applications in a scalable manner in the cloud.
Make a code change to simple webapp, and deploy it using CI/CD tools.
- Showcase - code change to deployment
- Architecture - What's going on????
- Wireguard setup connect everyone - Ping!
- Create github acc
- Make a code change to the web app
- Deploy docker container!
- Marvel at your new app
Terminal 1:
docker-compose -f drone-docker-compose.yml up
Terminal 2:
ngrok http 80
This repo uses Drone.io for CI. Useful tutorial by a guy from youtube:
https://www.youtube.com/watch?v=myCcJJ_Fk10&t=361s&ab_channel=ThatDevOpsGuy
- Github
Version control for your code. Sends a webhook on code change
- Drone.io
Performs actions on code change, triggered by webhook. In this case, builds our code into a lightweight portable Docker image. This makes things easily scalable and maintainable.
- Docker
Packages your application into a self-contained and OS agnostic image/container.
- Kubernetes
Deploys and manages your applications. I.e. Manages things like: secrets, ingress, when to restart, etc..
Place the file I have given you to /etc/wireguard/
sudo wg-quick up wg0
To see if it works, ping me
ping 10.0.2.1 # Ping cloud server
ping 10.0.2.3 # Ping JH
https://github.com/join
Then create a github PAT
https://catalyst.zoho.com/help/tutorials/githubbot/generate-access-token.html
Get a copy of this repo
git clone https://github.com/JunHaoChng/DroneCiDemo.git
Make a new branch
git checkout -b YOURNAME
- Make the code change here!
- Go to the nginx-hello/index.html file
- Line 5
- Change "Hello World" to "YOURNAME Hello World"
- Change the name of your docker image
- .drone.yml
- line 18
- Change the "10.0.2.3.../nginxhello" to "10.0.2.3.../YOURNAME-nginxhello" Save your code changes in Git
git commit -am 'New push!'
git push --set-upstream origin demo/YOURNAME # Use your github PAT here
docker run -P -p 8081:80 10.0.2.3:5000/YOURNAME-nginxhello
Opem your web browser and type in
http://localhost:8081
You should see the title of the webpage change to YOURNAME Hello World