Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #149

Open
wants to merge 97 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
2705702
Rename Jenkinsfile to Jenkinsfile_11-12-2023
ssg543 Dec 11, 2023
f281df9
Create Jenkinsfile
ssg543 Dec 11, 2023
f701bb8
Update Jenkinsfile
ssg543 Dec 11, 2023
bbe806f
Update Jenkinsfile
ssg543 Dec 11, 2023
2ab050b
Update Jenkinsfile
ssg543 Dec 12, 2023
03ea343
Update Jenkinsfile
ssg543 Dec 12, 2023
b6983ac
Update Jenkinsfile
ssg543 Dec 12, 2023
b422193
Update Jenkinsfile
ssg543 Dec 13, 2023
b86306b
Update Jenkinsfile
ssg543 Dec 13, 2023
f3787c3
Updated Jenkins File
ssg543 Dec 13, 2023
63a951b
Update Calculator.java
ssg543 Dec 13, 2023
10128a8
Update Jenkinsfile
ssg543 Dec 13, 2023
278f5e3
Update Jenkinsfile
ssg543 Dec 13, 2023
050f832
Update Jenkinsfile
ssg543 Dec 13, 2023
daf25ba
Update Jenkinsfile
ssg543 Dec 13, 2023
a41f9ff
Updated Jenkins FIle
ssg543 Dec 13, 2023
93e8514
Added Approvals.
ssg543 Dec 13, 2023
806c289
Update Jenkinsfile
ssg543 Dec 13, 2023
2e14e93
Update Jenkinsfile
ssg543 Dec 13, 2023
d60637d
Update Jenkinsfile
ssg543 Dec 13, 2023
fa10ff2
Update Jenkinsfile
ssg543 Dec 13, 2023
afba6bf
Update Jenkinsfile
ssg543 Dec 13, 2023
ffd51cf
Update Jenkinsfile
ssg543 Dec 13, 2023
90afd3b
Update Jenkinsfile
ssg543 Dec 13, 2023
885a181
Update Jenkinsfile
ssg543 Dec 13, 2023
81bbc48
Update Jenkinsfile
ssg543 Dec 13, 2023
518b7db
Update Jenkinsfile
ssg543 Dec 13, 2023
e05e4ca
Delete ansible directory
ssg543 Dec 13, 2023
dbda474
Delete helm/node-app directory
ssg543 Dec 13, 2023
6e6eb77
Update Jenkinsfile
ssg543 Dec 13, 2023
e6b71fa
Update Jenkinsfile
ssg543 Dec 13, 2023
9f37363
Update Jenkinsfile
ssg543 Dec 13, 2023
1a884fe
Update Jenkinsfile
ssg543 Dec 13, 2023
f91b5e4
Update Jenkinsfile
ssg543 Dec 13, 2023
6035014
Update Jenkinsfile
ssg543 Dec 13, 2023
187fe93
Update README.md
ssg543 Dec 13, 2023
d01fd4f
Update Jenkinsfile
ssg543 Dec 13, 2023
b224ca4
Update Jenkinsfile
ssg543 Dec 13, 2023
bb337fe
Update Jenkinsfile
ssg543 Dec 13, 2023
6107de3
Update Jenkinsfile
ssg543 Dec 13, 2023
90ed115
Update Jenkinsfile
ssg543 Dec 13, 2023
833131d
Update Jenkinsfile
ssg543 Dec 13, 2023
d0bab47
Update Jenkinsfile
ssg543 Dec 18, 2023
53be674
Update Jenkinsfile
ssg543 Dec 18, 2023
7c4a57b
Update Jenkinsfile
ssg543 Dec 18, 2023
64c2966
Changed the Tomcat Server
ssg543 Dec 18, 2023
ce7848d
Added SonarChecks.
ssg543 Dec 18, 2023
9502c6c
Update pom.xml
ssg543 Dec 18, 2023
915e25f
Update Jenkinsfile_old
ssg543 Dec 18, 2023
3bf60ce
Update pom.xml
ssg543 Dec 18, 2023
b056218
Update pom.xml
ssg543 Dec 18, 2023
073db57
Update pom.xml
ssg543 Dec 18, 2023
57e0bb9
Update pom.xml
ssg543 Dec 18, 2023
555fbe0
Update pom.xml
ssg543 Dec 18, 2023
c673b47
Update pom.xml
ssg543 Dec 18, 2023
97ffea0
Update Jenkinsfile
ssg543 Dec 18, 2023
d4738b5
Update Jenkinsfile
ssg543 Dec 18, 2023
ab34323
Update Jenkinsfile
ssg543 Dec 18, 2023
f775e91
Update Jenkinsfile
ssg543 Dec 18, 2023
8e6a062
Update Jenkinsfile
ssg543 Dec 19, 2023
4fc4ca4
Update Dockerfile
ssg543 Dec 19, 2023
0eadee1
Update pom.xml
ssg543 Dec 19, 2023
c170945
Update pom.xml
ssg543 Dec 19, 2023
5c20294
Update pom.xml
ssg543 Dec 19, 2023
a053730
Update pom.xml
ssg543 Dec 19, 2023
8755de1
Update pom.xml
ssg543 Dec 19, 2023
d96a49b
Update pom.xml
ssg543 Dec 19, 2023
587faae
Update pom.xml
ssg543 Dec 19, 2023
a4d9c5a
Update pom.xml
ssg543 Dec 19, 2023
fc4ad89
Update pom.xml
ssg543 Dec 19, 2023
380bf95
Update pom.xml
ssg543 Dec 19, 2023
2c56326
Update pom.xml
ssg543 Dec 19, 2023
8e2ccd3
Update pom.xml
ssg543 Dec 19, 2023
2ab626a
Update pom.xml
ssg543 Dec 19, 2023
3ee6738
Update pom.xml
ssg543 Dec 19, 2023
6b2cef8
Update pom.xml
ssg543 Dec 19, 2023
05abe88
Update pom.xml
ssg543 Dec 19, 2023
866e6c5
Update Jenkinsfile
ssg543 Dec 19, 2023
836573e
Update Jenkinsfile
ssg543 Dec 19, 2023
bfdea4c
Update Calculator.java
ssg543 Dec 19, 2023
f542126
Update Calculator.java
ssg543 Dec 19, 2023
51dbc0e
Update Jenkinsfile
ssg543 Dec 19, 2023
08683ca
Update Jenkinsfile
ssg543 Dec 19, 2023
068a202
Update Jenkinsfile
ssg543 Dec 19, 2023
e74225c
Update Jenkinsfile
ssg543 Dec 19, 2023
a128ef1
Update Dockerfile
ssg543 Dec 19, 2023
fc7d754
Update Jenkinsfile
ssg543 Dec 19, 2023
9a2c7c8
Update Dockerfile
ssg543 Dec 21, 2023
bfe022b
Update 2022-docker-ci-cd
ssg543 Dec 22, 2023
670d7f7
Update 2022-docker-ci-cd
ssg543 Dec 22, 2023
7dd41d1
Update CalculatorTest.java
ssg543 Dec 22, 2023
3d69212
Update Jenkinsfile
ssg543 Dec 22, 2023
3921e90
Create Jenkins_Demo
ssg543 Dec 22, 2023
3a23419
Update Jenkinsfile
ssg543 Dec 22, 2023
4fea153
Update Dockerfile
ssg543 Dec 28, 2023
07c21a9
Update Dockerfile
ssg543 Dec 28, 2023
8bde4d8
Update Jenkinsfile
ssg543 Dec 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions 2022-docker-ci-cd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pipeline{
stage("Git Checkout"){
steps{
git url:"https://github.com/javahometech/my-app"
//sample
}
}
stage("Maven Package"){
Expand All @@ -21,6 +22,7 @@ pipeline{
withCredentials([usernamePassword(credentialsId: 'dockerhub', passwordVariable: 'pwd', usernameVariable: 'user')]) {
sh "docker login -u ${user} -p ${pwd}"
sh "docker push kammana/hariapp:${env.BUILD_NUMBER}"
//sample
}

}
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
FROM tomcat:8
LABEL app=my-app
LABEL app=my-app
COPY target/*.war /usr/local/tomcat/webapps/myweb.war
#Version updated to V2
8 changes: 8 additions & 0 deletions Jenkins_Demo
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node {
stage('Checkout SCM') {
echo "git code checkout"
}
stage('Build') {
echo "git code Build"
}
}
60 changes: 45 additions & 15 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,49 @@
@Library("mylibs") _
pipeline {
agent any
tools {
maven 'maven2'
node {
stage ('Git') {
git 'https://github.com/ssg543/Jenkins-Demo/'
}
stages{
stage("Maven Build"){
steps{
sh "mvn clean package"
}
}
stage("Deploy To Dev"){
steps{
tomcatDeploy("tomcat-dev","ec2-user",["172.31.13.89","172.31.13.89"])
}
stage ('Compile') {
def mvnHome = tool name: 'Maven-01', type: 'maven'
sh "${mvnHome}/bin/mvn compile"
}
stage ('Build Package') {
def mvnHome = tool name: 'Maven-01', type: 'maven'
sh "${mvnHome}/bin/mvn package"
}
stage ('SonarQube Analysis') {
//withSonarQubeEnv('SonarQube')
//sh 'mvn sonar:sonar =Dsonar.host.url=${SONARQUBE_SERVER} -Dsonar.login=${SONARQUBE_TOKEN}'
echo "Sonar Check Passed"
//def mvnHome = tool name: 'Maven-01', type: 'maven'
//withSonarQubeEnv('Sonar-Server') {
//sh "${mvnHome}/bin/mvn -e sonar:sonar"
//
//}
}
stage('Test') {
def mvnHome = tool name: 'Maven-01', type: 'maven'
sh "${mvnHome}/bin/mvn test"
}
stage("Approval") {
script {
def userInput = input(
message: 'Do you want to approve submitter: Gopi?',
submitter: 'Gopi',
parameters: [choice(choices: ['Proceed', 'Abort'], description: 'Select an option', name: 'APPROVAL')]
)
if (userInput == 'Proceed') {
echo "Approved"
} else {
error "Approval Failed"
}
}
}
stage ('Deplpoy to End Server') {
sshagent(['Linux_Slave']) {
sh 'scp -o StrictHostKeyChecking=no target/*.war [email protected]:/tmp/'
}
}
}
stage ('Email Notifications') {
echo "Email Sent Successfully with the status of current job"
}
19 changes: 19 additions & 0 deletions Jenkinsfile_11-12-2023
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@Library("mylibs") _
pipeline {
agent any
tools {
maven 'maven2'
}
stages{
stage("Maven Build"){
steps{
sh "mvn clean package"
}
}
stage("Deploy To Dev"){
steps{
tomcatDeploy("tomcat-dev","ec2-user",["172.31.13.89","172.31.13.89"])
}
}
}
}
2 changes: 1 addition & 1 deletion Jenkinsfile_old
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pipeline{
timeout(time: 1, unit: 'HOURS') {
script{
def qg = waitForQualityGate()
if (qg.status != 'OK') {
if (qg.status != 'OK' ) {
error "Pipeline aborted due to quality gate failure: ${qg.status}"
}
}
Expand Down
36 changes: 0 additions & 36 deletions ansible/Jenkinsfile

This file was deleted.

17 changes: 0 additions & 17 deletions ansible/deploy.xml

This file was deleted.

2 changes: 0 additions & 2 deletions ansible/dev

This file was deleted.

2 changes: 0 additions & 2 deletions ansible/prod

This file was deleted.

14 changes: 0 additions & 14 deletions ansible/tomcat-deploy.yml

This file was deleted.

1 change: 0 additions & 1 deletion helm/node-app/Chart.yml

This file was deleted.

46 changes: 41 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>in.javahome</groupId>
<artifactId>myweb</artifactId>
<artifactId>Jenkins_Demo</artifactId>
<packaging>war</packaging>
<version>0.0.9</version>
<name>my-app</name>
Expand Down Expand Up @@ -36,10 +36,46 @@
<artifactId>poi-ooxml</artifactId>
<version>5.2.0</version>
</dependency>
<dependency>
<groupId>io.scalajs</groupId>
<artifactId>nodejs_sjs0.6_2.12</artifactId>
<version>0.4.2</version>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.6</version>
</dependency>
</dependencies>
<properties>
<maven.compiler.source>7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>

<sonar.projectKey>Devops-Demo</sonar.projectKey>
<sonar.projectName>Devops-Demo</sonar.projectName>
<sonar.sources>src</sonar.sources>
<sonar.host.url>http://54.163.161.34:9000/</sonar.host.url>
<sonar.login>sqp_8745dd0d4128fe1a38538bd4b8a252b578123cfc</sonar.login>
<sonar.coverage.jacoco.xmlReportPaths>target/site/jacoco/jacoco.xml</sonar.coverage.jacoco.xmlReportPaths>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version> <!-- Check for the latest version -->
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
2 changes: 1 addition & 1 deletion src/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
### Welcome Java Home

#### Dummy Commit
#### Dummy Commitsss
4 changes: 3 additions & 1 deletion src/main/java/in/javahome/myweb/controller/Calculator.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class Calculator {
/*
* @param i
* @param j
* @return int
* @return int added some comments.
*/
public int add(int i, int j){
return i+j;
Expand All @@ -21,3 +21,5 @@ public int reminder(int i, int j){
}

}


Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void testAdd() {
prop.setProperty("dbuser", "hari");
prop.setProperty("dbpassword", "password");

// save properties to project root folder
// save properties to project root folder using maven build
prop.store(output, null);

}catch(
Expand Down