Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
9106916
added junit
amarama09 Feb 10, 2018
e009e5d
added junit
amarama09 Feb 10, 2018
9048446
added junit
amarama09 Feb 10, 2018
e65f242
updated gitignore
amarama09 Feb 10, 2018
6ecd48c
gave the slave label
amarama09 Feb 10, 2018
baba4d0
gave the slave label
amarama09 Feb 10, 2018
8f0cec6
gave the slave label
amarama09 Feb 10, 2018
8d0929b
added lines to jenkinsfile to deploy to httpd
amarama09 Feb 12, 2018
60366ee
my fix
amarama09 Feb 12, 2018
a19ecd5
added the functionality testing to cetos and debeian docker
amarama09 Feb 12, 2018
fb091f4
fixed jenkins file indentation
amarama09 Feb 12, 2018
8b961aa
added cp to green folder
amarama09 Feb 14, 2018
ffabd9a
fixed jenkins path to green folder
amarama09 Feb 14, 2018
3e06858
new google cloud trails
amarama09 Feb 15, 2018
40afa0a
new 2 Goodle 2
amarama09 Feb 15, 2018
b42f37e
new 2 Goodle 4
amarama09 Feb 15, 2018
c3dca9c
new 2 Goodle 5
amarama09 Feb 15, 2018
815c956
trigger scm
amarama09 Feb 15, 2018
ba8e794
Merge branch 'Amar02' of github.com:amarama09/content-jenkins-java-pr…
amarama09 Feb 15, 2018
d8e4ed9
this is a trigger2
amarama09 Feb 15, 2018
566b7fd
trigger scm
amarama09 Feb 15, 2018
756816f
trigger multibranch
amarama09 Feb 15, 2018
7150148
this thing sucks
amarama09 Feb 15, 2018
36fb398
this thing sucks 3
amarama09 Feb 15, 2018
4987a10
this is it
amarama09 Feb 15, 2018
83b29df
one line
amarama09 Feb 15, 2018
a21689a
trigger the pipeline
amarama09 Feb 15, 2018
2fe436d
Merge branch 'Amar03' into Amar02
amarama09 Feb 15, 2018
c6e3390
added an empty file
amarama09 Feb 15, 2018
aab76ba
from the server
Feb 15, 2018
70bf062
fixed on the server
Feb 15, 2018
fdfdcfd
one more time
amarama09 Feb 15, 2018
e619b8a
Merge branch 'Amar03' into Amar02
Feb 15, 2018
07cf910
one more time 1
amarama09 Feb 15, 2018
8117619
np 12
amarama09 Feb 15, 2018
c286f70
np 13
amarama09 Feb 15, 2018
efc9ea0
14
amarama09 Feb 15, 2018
6d2064d
15
amarama09 Feb 15, 2018
3e898ef
Merge branch 'Amar03' into Amar02
Feb 15, 2018
16d73e1
16
amarama09 Feb 15, 2018
35b6d7b
Merge branch 'Amar03' into Amar02
Feb 15, 2018
03cfa96
15
amarama09 Feb 15, 2018
82487fe
conflict resolve
amarama09 Feb 15, 2018
2536992
16
amarama09 Feb 15, 2018
8b0a33e
17
amarama09 Feb 15, 2018
17617a9
18
amarama09 Feb 15, 2018
73377ee
19
amarama09 Feb 15, 2018
39f928c
added email notifications
amarama09 Feb 15, 2018
b21608d
added email code 2
amarama09 Feb 15, 2018
43c6d2e
added email code 3
amarama09 Feb 15, 2018
2b8d003
added email code 4
amarama09 Feb 15, 2018
8b189f6
added email code 5
amarama09 Feb 15, 2018
c58bab0
added email code 6
amarama09 Feb 15, 2018
b9135b7
added email code 7
amarama09 Feb 15, 2018
fe77908
added lines to test pipeline library
amarama09 Feb 16, 2018
b2e318b
23
amarama09 Feb 16, 2018
4ddfd93
added stage name
amarama09 Feb 16, 2018
e50ce37
removed arg on SayHello call
amarama09 Feb 16, 2018
6128184
fixed unexpected token issues
amarama09 Feb 16, 2018
d521222
undid it
amarama09 Feb 16, 2018
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ bin/*
dist/*
reports/*
docs/*
Jenkinsfile_01
152 changes: 148 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,167 @@
pipeline {
agent any

agent none


environment{

MAJOR_VERSION=1

}


stages {
stage('Unit Tests') {

agent{
label 'apache'
}

steps {


sh 'ant -f test.xml -v'
//
junit 'reports/result.xml'

}
}
stage('build') {

agent{

label 'apache'

}

steps {
sh 'ant -f build.xml -v'
}

post {
success {

archiveArtifacts artifacts: 'dist/*.jar', fingerprint: true

}
}


}

stage('deploy'){

agent{
label 'apache'
}

steps{
sh "mkdir -p /var/www/html/rectangles/all/${env.BRANCH_NAME}"
sh "cp dist/rectangle_${env.MAJOR_VERSION}.${env.BUILD_NUMBER}.jar /var/www/html/rectangles/all/${env.BRANCH_NAME}"
}

}


stage('functional check on debian'){

agent{
label 'agentOne'
}

steps{
sh "wget http://35.230.114.105/rectangles/all/${env.BRANCH_NAME}/rectangle_${env.MAJOR_VERSION}.${env.BUILD_NUMBER}.jar"
sh "java -jar rectangle_${env.MAJOR_VERSION}.${env.BUILD_NUMBER}.jar 54 321"
}
}

stage('promote to green' ){

agent{
label 'apache'
}

when{
branch 'Amar02'
}

steps{

sh "cp /var/www/html/rectangles/all/${env.BRANCH_NAME}/rectangle_${env.MAJOR_VERSION}.${env.BUILD_NUMBER}.jar /var/www/html/rectangles/green"

}
}



// Added this stage for automatic branch promotions ...
stage('Promote Amar03 to Amar02'){

agent{
label 'apache'
}



when {
branch 'Amar03'
}

steps{
echo "Stashing any local changes.."
sh "git stash"
echo "Checking Out Amar03"
sh "git checkout Amar03"
sh "git pull"
echo "Checking Out Amar02"
sh "git checkout Amar02"
echo "Merging Amar03"
sh "git merge Amar03"
echo "Pushing to Origin Amar02"
sh 'git push origin Amar02'
echo 'NO PROBLEMS 23'
sh "git tag -a ${env.MAJOR_VERSION}.${env.BUILD_NUMBER} -m ${env.GIT_COMMIT}"
sh "git push origin ${env.MAJOR_VERSION}.${env.BUILD_NUMBER}"
}

post{
success{
emailext(subject:"SUCCESSFUL Amar03 Promoted to Amar02 : Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
body: """<p>SUCCESSFUL: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
<p>Check console output at &QUOT;<a href='${env.BUILD_URL}'>${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>&QUOT;</p>""",

to:"srinuamar9@gmail.com")
}

failure{
emailext (subject: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
body: """<p>FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
<p>Check console output at &QUOT;<a href='${env.BUILD_URL}'>${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>&QUOT;</p>""",
to:"srinuamar9@gmail.com")
}


}

}


}

post {
always {
archiveArtifacts artifacts: 'dist/*.jar', fingerprint: true

post{

always{

emailext(subject:"ENTER THE PROJECT ${env.JOB_NAME} BUILD ${env.BUILD_NUMBER}",
body: "FIND THE LOG HERE ${env.BUILD_URL}",
to:"srinuamar9@gmail.com")

}


}



}
94 changes: 94 additions & 0 deletions Jenkinsfile0
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
pipeline {

agent none

stages {
stage('Unit Tests') {

agent{
label 'apache'
}
steps {
sh 'ant -f test.xml -v'
junit 'reports/result.xml'
}
}
stage('build') {

agent{
label 'apache'
}

steps {
sh 'ant -f build.xml -v'
}

post {
success {
archiveArtifacts artifacts: 'dist/*.jar', fingerprint: true
}
}


}

stage('deploy'){

agent{
label 'apache'
}

steps{
sh "cp dist/rectangle_${env.BUILD_NUMBER}.jar /var/www/html/rectangles/all/"
}

}




stage('functional check on docker debian'){

agent{
docker 'openjdk:8u151-jre'
}

steps{
sh "wget http://srinuamar91.mylabserver.com/rectangles/all/rectangle_${env.BUILD_NUMBER}.jar"
sh "java -jar rectangle_${env.BUILD_NUMBER}.jar 54 321"
}


}

stage('functional check on centos'){

agent{
label 'centos'
}

steps{
sh "wget http://srinuamar91.mylabserver.com/rectangles/all/rectangle_${env.BUILD_NUMBER}.jar"
sh "java -jar rectangle_${env.BUILD_NUMBER}.jar 54 321"
}
}

stage('promote to green' ){

agent{
label 'apache'
}

steps{

sh "cp /var/www/html/rectangles/all/rectangle_${env.BUILD_NUMBER}.jar /var/www/html/rectangles/green"

}
}


}



}
50 changes: 50 additions & 0 deletions Jenkinsfile_01
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
pipeline{
agent none

environment{

ENV_VAR='some_value'

}

stages{
stage('build'){
agent{
label 'centos'
}
steps{
echo 'building..'
}
stage('test'){
agent docker
agent{
docker 'openjdk:8u121-jre'
}

steps{
echo 'testing...'
}
}





stage('deploy'){
steps{
echo 'deploying...'
}
}
}


post{

always{

archive 'dist/*.jar'
}

}

}
2 changes: 1 addition & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

<!--Creates the deployable jar file -->
<target name="jar" depends="compile">
<jar destfile="${dist.dir}\rectangle.jar" basedir="${build.dir}">
<jar destfile="${dist.dir}\rectangle_${env.MAJOR_VERSION}.${env.BUILD_NUMBER}.jar" basedir="${build.dir}">
<manifest>
<attribute name="Main-Class" value="Rectangulator" />
</manifest>
Expand Down
Empty file added sample
Empty file.