This repo provides two variants for deploying Jenkins and SonarQube:
- Using Docker Compose
- Using AWS EC2 instances with Terraform and Ansible
This approach uses Docker Compose to deploy Jenkins, SonarQube, and a PostgreSQL database for SonarQube. Additionally, it provisions a jenkins/ssh-agent
container to pair with Jenkins as its node.
- Docker
- Docker Compose
-
Clone the repository:
git clone https://github.com/your-repo/jenkins-sonarqube.git cd jenkins-sonarqube
-
Start the services:
docker network create jenkins docker compose up -d
-
Access the services:
- Jenkins:
http://localhost:8080
- SonarQube:
http://localhost:9000
- Jenkins:
This approach uses Terraform to provision EC2 instances on AWS and Ansible to configure Jenkins and SonarQube on those instances.
- Terraform
- Ansible
- AWS CLI configured with appropriate credentials
- YQ (to parse YAML. https://github.com/mikefarah/yq )
-
Navigate to the
terraform-ansible-ec2
directory:cd terraform-ansible-ec2
-
Follow the instructions in the README file located in the
terraform-ansible-ec2
folder to provision and configure the instances.
MIT