- Jenkins
- Prometheus
- Grafana
- Docker
- SonarQube
- Owasp
- Trivy scan
- To get started create a ec2 instance.
- Preferably you need two instances a t2.large and a t2.micro one for monitoring and the other one for the whole pipeline.
- So in total we have 3 servers:
- The server on which app is deployed
- Monitoring server
- Pipelines server
- For the app i'll be using a Netflix clone Netflix Clone
Important
Make sure you use vpn while using the api or the app as for some reason TMDB doesnt work in India.
docker-compose up
The docker-compose file has 5 containers
β Container node-exporter
β Container localstack
β Container grafana
β ContainerΒ jenkins
β Container trivy
Note: Learn more about docker-compose here: docker-compose
- Now you'll see 5 services running on your system.
- Checkout docker/prometheus.yml this will contain the config for prometheus monitoring basically all the plugins and the dependencies for prometheus.
- Adding email service:
- Go to your google account manager and generate a password for an app in the security section.
- Head over to https://localhost:8080/ to jenkins and enter the password for jenkins.
NOTE: sudo docker exec ${CONTAINER_ID or CONTAINER_NAME} cat /var/jenkins_home/secrets/initialAdminPassword
- Search for email extension and download it
-
Goto Manage Jenkins βPlugins β Available Plugins β
-
Install below plugins
-
1 β Eclipse Temurin Installer (Install without restart)
-
2 β SonarQube Scanner (Install without restart)
-
3 β NodeJs Plugin (Install Without restart)
-
Docker, Docker api, Docker Commons, Docker Pipelines, docker-build-step
-
OWASP Dependency Check Plugin
-
Configure all the tools for Java, Nodejs, OWASP, Email, SonarQube.
-
Add Global Credentials for Docker & Email using your username and passwords.
-
Create a Job
-
create a job as Netflix Name, select pipeline and click on ok.
-
Add the script in the Jenkins/jenkinsfile
-
Read the file and modify as needed