Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
12859af
Update README.md
MohammedImranTK Apr 19, 2022
2e9d5d8
Update README.md
MohammedImranTK Apr 19, 2022
f8bd0cb
created jenkins file
MohammedImranTK Apr 20, 2022
2c47e5e
Update Jenkinsfile
MohammedImranTK Apr 20, 2022
8e96a8e
added artifcates fetch
MohammedImranTK Apr 20, 2022
2f9e23f
Update README.md
MohammedImranTK Apr 20, 2022
0121c64
Update README.md
MohammedImranTK Apr 20, 2022
9054786
Merge pull request #1 from MohammedImranTK/MohammedImranTK-featurebranch
MohammedImranTK Apr 20, 2022
fc579e4
Update README.md
MohammedImranTK Apr 20, 2022
1a4620b
Merge pull request #2 from MohammedImranTK/MohammedImranTK-featurebranch
MohammedImranTK Apr 20, 2022
bdfe606
Update README.md
MohammedImranTK Apr 20, 2022
8600267
Merge pull request #3 from MohammedImranTK/MohammedImranTK-patch-1
MohammedImranTK Apr 20, 2022
ab0d6d0
testing
Apr 21, 2022
b164557
added multi stage Dockerfile to build sysfoo app
MohammedImranTK Apr 22, 2022
2fe23b7
added docker Bnp
MohammedImranTK Apr 22, 2022
eb6fa5a
added branch condition
MohammedImranTK Apr 22, 2022
b95bb53
Update Jenkinsfile
MohammedImranTK Apr 22, 2022
1413c93
Update Jenkinsfile
MohammedImranTK Apr 22, 2022
a55d709
Update Jenkinsfile
MohammedImranTK Apr 22, 2022
bd84be6
Update Jenkinsfile
MohammedImranTK Apr 22, 2022
a8f9225
added script
MohammedImranTK Apr 22, 2022
245c1f3
Update Jenkinsfile
MohammedImranTK Apr 22, 2022
bfa033b
Update Jenkinsfile
MohammedImranTK Apr 22, 2022
05c7752
updated the parallel stage
MohammedImranTK Apr 22, 2022
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
83 changes: 83 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
pipeline {
agent any
stages {
stage('build') {
agent {
docker {
image 'maven:3.6.3-jdk-11-slim'
}

}
steps {
echo 'compiling sysfoo app...'
sh 'mvn compile'
}
}

stage('test') {
agent {
docker {
image 'maven:3.6.3-jdk-11-slim'
}

}
steps {
echo 'running unit tests....'
sh 'mvn clean test'
}
}
stage ('running tests parallel'){
parallel{
stage('package') {

agent {
docker {
image 'maven:3.6.3-jdk-11-slim'
}
}

steps {
script {
if (env.BRANCH_NAME == 'master'){
echo 'generating artifact....'
sh 'mvn package -DskipTests'
archiveArtifacts 'target/*.war'
} else {
echo 'This is not master branch'}

}
}
}
stage('Docker BnP.') {
agent any
steps {
script {
if (env.BRANCH_NAME == 'master'){
docker.withRegistry('https://index.docker.io/v1/', 'dockerlogin') {
def dockerImage = docker.build("mohammedimrantk/sysfoo:v${env.BUILD_ID}", "./")
dockerImage.push()
dockerImage.push("latest")
dockerImage.push("dev")
}
}else {
echo 'This is not master branch'}
}
}
}

}
}
}


tools {
maven 'Maven 3.6.3'
}
post {
always {
echo 'This pipeline is completed..'
}

}
}

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
This is a Sample Maven App.
changed this readme, to test the jenkins app
again changed to check the git
updated this file to test scan option
this is ti create new branch and pull request
test this branching again
test this with permissions
9 changes: 9 additions & 0 deletions dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM maven:3.6.3-jdk-11-slim as build
WORKDIR /opt/demo
COPY . /opt/demo
RUN mvn package -DskipTests

FROM tomcat:jre8-openjdk-slim-buster as run
WORKDIR /usr/local/tomcat
COPY --from=build /opt/demo/target/sysfoo.war webapps/ROOT.war

Empty file added test.md
Empty file.