This project uses Jenkins Pipeline to automate the build, test, and deployment processes. The Jenkins Pipeline is defined in a Jenkinsfile
located at the jenkins
directory of the repository.
- Follow the Jenkins official documentation for Jenkins Installation.
- Jenkins installed and running
- Jenkins Pipeline plugin installed
- Appropriate credentials and permissions set up in Jenkins
- Access to the necessary build tools and environments (e.g., Docker)
The pipeline consists of the following stages:
- Checkout: Fetch the latest code from the repository.
- OWASP Scan: Check the depencency.
- Trivy Scan: Scan the application.
- SonarQube Analysis: Analyse the code using sonarqube.
- Build: Compile the source code and build the application.
- Test: Run unit and integration tests to verify the application.
- Deploy: Deploy the application to the staging/production environment.
The Jenkinsfile
contains the pipeline script.
-
Clone the Repository:
git clone [https://github.com/your-repo/project.git](https://github.com/praks7v/BloggersUnity.git) cd BloggersUnity
-
Configure Jenkins:
- Open Jenkins and navigate to the "New Item" page.
- Create a new Pipeline job and configure it to use the
Jenkinsfile
from the repository.
Plugins to install:
-
docker plugins
-
OWASP Dependency-Check Plugin
-
Pipeline
-
SonarQube Scanner for Jenkins
SonarQube Installation
To pull sonarqube docker iamge, use the following command:
docker pull sonarqube:lts-community
To run sonarqube docker iamge, use the following command:
docker run -d --name sonarqube -p 9000:9000 sonarqube:lts-community
To access the sonarqube on browser http://localhost:9000/
.
To login default username and password is admin
.
after go to the http://localhost:9000/admin/users
create a token for jenkins credentials.
Add Credentials for SonarQube at global scope (add as a secret text):
Configure system for SonarQube:
Configure tools:
- Sonarqube
- OWASP Dependency Check
- Docker
- Run the Pipeline:
- Trigger the pipeline manually or configure it to run automatically based on certain triggers (e.g., commit to the repository).
Make sure to configure any necessary environment variables in Jenkins for your build and deployment processes.
- Ensure all paths and commands in the
Jenkinsfile
andMakefile
are correct. - Verify Jenkins has the necessary permissions to access the repository and execute the pipeline stages.
- Check the Jenkins logs for detailed error messages if the pipeline fails.
Feel free to submit pull requests or open issues if you encounter any problems or have suggestions for improvements.
This project is licensed under the MIT License.