This repo provides two variants for deploying Jenkins and SonarQube:
- Using Docker Compose.
- Using AWS EC2 instances with Terraform and Ansible.
- Via Kubernetes as deployments.
- @TODO using Helm charts via Terraform.
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/nthskyradiated/jenkins-sonarqube.git cd jenkins-sonarqube/docker-compose -
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-ec2directory:cd terraform-ansible-ec2 -
Follow the instructions in the README file located in the
terraform-ansible-ec2folder to provision and configure the instances.
MIT