-
Create a GitHub Repository with the name
Jenkins-Realworld-CICD-Project
and push the code in this branch(main) to your remote repository (your newly created repository).- Go to GitHub: https://github.com
- Login to
Your GitHub Account
- Create a Repository called
Jenkins-Realworld-CICD-Project
- Clone the Repository in the
Repository
directory/folder on yourlocal machine
- Download the code in in this repository
"Main branch"
: https://github.com/awanmbandi/realworld-microservice-project.git Unzip
thecode/zipped file
Copy
andPaste
everythingfrom the zipped file
into therepository you cloned
in your local- Open your
Terminal
- Add the code to git, commit and push it to your upstream branch "main or master"
- Add the changes:
git add -A
- Commit changes:
git commit -m "adding project source code"
- Push to GitHub:
git push
- Confirm that the code is now available on GitHub
-
Jenkins/Maven
- Create a Jenkins VM instance
- Name:
Jenkins/Maven/Ansible
- AMI:
Amazon Linux 2
- Instance type:
t2.medium
- Key pair:
Select
orcreate a new keypair
- Security Group (Edit/Open):
8080, 9100
and22 to 0.0.0.0/0
- IAM instance profile: Select the
AWS-EC2FullAccess-Role
- User data (Copy the following user data): https://github.com/awanmbandi/realworld-cicd-pipeline-project/blob/maven-nexus-sonarqube-jenkins-install/jenkins-install.sh
- Launch Instance
-
SonarQube
- Create a SonarQube VM instance
- Name:
SonarQube
- AMI:
Ubuntu 20.04
- Instance type:
t2.medium
- Key pair:
Select a keypair
- Security Group (Eit/Open):
9000, 9100
and22 to 0.0.0.0/0
- User data (Copy the following user data): https://github.com/awanmbandi/realworld-cicd-pipeline-project/blob/maven-nexus-sonarqube-jenkins-install/sonarqube-install.sh
- Launch Instance
-
JFrog Artifactory
- Create a Nexus VM instance
- Name:
JFrog-Artifactory
- AMI:
Amazon Linux 2
- Instance type:
t2.medium
- Key pair:
Select a keypair
- Security Group (Eit/Open):
8081, 8082
and22 to 0.0.0.0/0
- User data (Copy the following user data): https://github.com/awanmbandi/realworld-cicd-pipeline-project/blob/maven-nexus-sonarqube-jenkins-install/nexus-install.sh
- Launch Instance
- Navigate to http://JFROG_PUBLIC_IP:8082
- Default username:
admin
- Default password:
password
- New password:
Admin2024
Password must meet the specified criteria - Select Base URL: http://YOUR_JFROG_PUBLIC_IP:8082
- Configure Default Proxy:
Skip
- Create Repositories: Select
Maven
and clickNext
- Click
Finish
-
Copy your Jenkins Public IP Address and paste on the browser = ExternalIP:8080
- Login to your Jenkins instance using your Shell (GitBash or your Mac Terminal)
- Copy the Path from the Jenkins UI to get the Administrator Password
- Plugins: Choose
Install Suggested Plugings
- Provide
- Username:
admin
- Password:
admin
Name
andEmail
can also be admin. You can useadmin
all, as its a poc.
- Username:
- Click
Continue
- Click on
Start using Jenkins
-
- Click on
Manage Jenkins
- Click on
Plugins
- Click
Available
- Search and Install the following Plugings and
"Install"
- SonarQube Scanner
- Artifactory
- Maven Integration
- Pipeline Maven Integration
- Maven Release Plug-In
- Build Timestamp (Needed for Artifact versioning)
- Click on
Install
- Once all plugins are installed
- Select/Check the Box Restart Jenkins when installation is complete and no jobs are running
- Click on
-
- Click on
Manage Jenkins
- Click on
Credentials
- Click on
Global
(unrestricted) - Click on
Add Credentials
-
-
- Login to your SonarQube Application (http://SonarServer-Sublic-IP:9000)
- Default username:
admin
- Default password:
admin
- Default username:
- Click on
Projects
- Click on
Create New Project
- Project key:
Webapp-Project
- Display name:
Webapp-Project
- Project key:
- Click on
Set Up
- Generate a Tokens: Provide Name
Webapp-SonarQube-Token
- Click on
Generate
- Click on
Continue
- Run analysis on your project: Select
Java
- Build technology: Select
Maven
- COPY the
TOKEN
- Login to your SonarQube Application (http://SonarServer-Sublic-IP:9000)
-
- Navigate back to Jenkins
- Click on
Add Credentials
- Kind: Secret text!!
- Secret:
Paste the SonarQube token
value that we have created on the SonarQube server - ID:
SonarQube-Token
- Description:
SonarQube-Token
- Click on Create
-
- Click on
-
-
- Click on
Add Credentials
- Kind: Username with password
- Username:
admin
- Password:
Admin2024
- ID:
JFrog-Credential
- Description:
JFrog-Credential
- Click on
Create
- Click on
-
- Click on