- Linux
- Git and GitHub
- Docker
- Docker-compose
- Jenkins CI/CD using web hooks
-
AWS EC2 instance (Ubuntu) with instance type t2.large or micro and root volume 29GB.
-
Jenkins installed
- Reference: Jenkins installation
-
Docker installled
sudo apt-get update
sudo apt-get install docker.io
-
Enabled handshake between jenkins and github and generating ssh key-gen
- Associating private key with jenkins
- Associaating public key with github
Note when you build the application in jenkins, it pulls your repo and and creates a dumps in jenkins. Check below image
Add jenkins as a user inside docker group to allow jenkins to interact, build and run docker containers.
sudo -a -G docker jenkins
- Using docker
sudo docker build . -t <image-name>
sudo docker run -d -p 8000:8000 <image-name (same as above)>
Note you can access the application using host ip:host port
- Using build steps in jenkins
run the above commands as build steps, so that you can run the application directly from jenkins build and not having to run the docker build and run manually. Check the below image
- Finally!! --> Automate the CI/CD pipeline and deploy the web application using webhooks, orchestrating docker build and run using commit trigger in jenkins. Check the below imaage for integration Adding the jenkins-url followed by /github-webhook/ Enabling build trigger which will then trigger build steps on code commit to start the automatic CI/CD pipeline.
-Now make update to the js file and commit the changes and see the magic happen!