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

Chilu49 patch 1 #3

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
45ef990
created jenkinsfile
chilu49 Jun 7, 2018
1039561
removed chris and chad email
chilu49 Jun 7, 2018
9b8b208
modified jenkinsfile
chilu49 Jun 7, 2018
771c094
updated jenkinsfile with correct directory
chilu49 Jun 7, 2018
b89a0b1
Increased Commit Messages Lines
chilu49 Jun 12, 2018
ab1776b
Modified Jenkinsfile
chilu49 Jun 12, 2018
2a654ff
updated jenkinsfile
chilu49 Jun 12, 2018
53b2279
Changed Jenkins file to include more info about git commit
chilu49 Jun 12, 2018
481a465
updated jenkins file
chilu49 Jun 12, 2018
59b21e0
updated jenkinsfile with previous build logic
chilu49 Jun 12, 2018
c47ed17
Updateded Jenkinsfile with previous build information
chilu49 Jun 12, 2018
77fe946
Update Jenkinsfile
chilu49 Jun 12, 2018
3720bc6
updated jenkins file
chilu49 Jun 12, 2018
f42e986
update jenkins file testingkalsklasjdlkfj
chilu49 Jun 13, 2018
861ebe1
updated jenkinsfile aksdjlkf aslkdjflkasd alksdjflka lkjakjasdlkfj k…
chilu49 Jun 13, 2018
3f3424e
updated jenkinsfile asdffffffffffffffffffffffffffff asdfffffffffff
chilu49 Jun 13, 2018
c4efef2
Testing
chilu49 Jun 13, 2018
8a08a01
testingtestingtestingtest testingtestingtestingtest testingtestingtes…
chilu49 Jun 13, 2018
b42e602
updated jenkinfilekjlllllllllllllllllllllllllllllllllllllllllllllllll…
chilu49 Jun 13, 2018
b367bd0
update jenkins file .skadjflkkkkkkkk lkjasdkflasd lkajsdlkfj
chilu49 Jun 14, 2018
9724407
asdf asdfffffffff sadfsdddddddddddddddddddddddd dsafffffffffffff
chilu49 Jun 14, 2018
bb43803
asdfffffffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffff…
chilu49 Jun 14, 2018
8abfe88
asdfffffff dsafasdfdfsadfasdfsfasdf
chilu49 Jun 14, 2018
57ed839
asdfffffffffffffffffffffffffffffffa asdfasdfasdfasdf asdfasdfasdfasdf
chilu49 Jun 14, 2018
76ac0a9
adsfhj asdjhfjk asdjhfajksd ;asjdfkjhasdjkf aslkdjhfajksdf hlkjhaskl…
chilu49 Jun 14, 2018
9f8dcfd
12345678901234567890123456789012345678901234567890 1234567890
chilu49 Jun 14, 2018
de3cf01
2345678901234567890123456789012345678901234567890 1234567890
chilu49 Jun 14, 2018
4f95966
2345678901234567890123456789012345678901234567890 1234567890 12345678…
chilu49 Jun 14, 2018
be1d558
2345678901234567890123456789012345678901234567890 1234567890123456789…
chilu49 Jun 14, 2018
c961a30
11111111111111111111111111111111111111 11111111111111111111 111111111…
chilu49 Jun 14, 2018
9267ef3
updated jenkinsfile
chilu49 Jul 26, 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
91 changes: 91 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
node {
notify1('Started testing-whaleapp build')
try {
stage('Checkout') {
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[url: 'https://github.com/chilu49/hellowhale.git']]])
}
stage('Build Image And Push') {
dir('/opt/jenkins/workspace/testing-asdfkljasdf/'){
def app = docker.build ("testing-whaleapp:${env.BUILD_ID}")
}
}

stage ('Deploy-dev') {
//build job: 'account-service-pipeline', wait: false
sh ''' docker stop testing-whaleapp'''
sh ''' docker rm testing-whaleapp '''
sh ''' docker run -d -it --name testing-whaleapp testing-whaleapp:${BUILD_NUMBER}'''

}
notify2('Successfully Deployed testing-whaleapp')
} catch (err) {
notify1("Error {err}")
currentBuild.result = 'FAILURE'
}
}
@NonCPS
def getChangeLog(passedBuilds) {
def changeString = ""
for (int x = 0; x < passedBuilds.size(); x++) {
def currentBuild = passedBuilds[x];
def changeLogSets = currentBuild.changeSets
for (int i = 0; i < changeLogSets.size(); i++) {
def entries = changeLogSets[i].items
for (int j = 0; j < entries.length; j++) {
def entry = entries[j]
changeString += "* ${entry.msg} by ${entry.author} \n"
}
}
}
if (!changeString) {
changeString = " - No new changes"
}
return log;
}

@NonCPS
def getChangeString() {
MAX_MSG_LEN = 1000
def changeString = ""
echo "Gathering SCM changes"
def changeLogSets = currentBuild.changeSets
echo "${changeLogSets}"
echo "${changeLogSets.size()}"
for (int i = 0; i < changeLogSets.size(); i++) {
def entries = changeLogSets[i].items
for (int j = 0; j < entries.length; j++) {
def entry = entries[j]
truncated_msg = entry.msg.take(MAX_MSG_LEN)
changeString += " - ${truncated_msg} [${entry.author}]\n"
}
}

if (!changeString) {
changeString = " - No new changes"
}
return changeString
}

def notify1(status){
emailext(
to: "[email protected]",
subject: "${status}:' [${env.BUILD_NUMBER}]'",
body: """<p>${status}: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
<p>Check console output at <a href='${env.BUILD_URL}'>${env.JOB_NAME} [${env.BUILD_NUMBER}]</a></p>"""
)
}
def notify2(status){
emailext(
to: "[email protected]",
subject: "${status}: Job ${env.JOB_NAME} [${env.BUILD_NUMBER}]",
body: "Changes:\n " + getChangeString() + "\n\n<br> Check console output at: $BUILD_URL/console" + "\n"
)
}
def notify3(status){
emailext(
to: "[email protected]",
subject: "${status}:' [${env.BUILD_NUMBER}]'",
body: "Changes:\n " + getChangeString() + "\n\n<br> Check console output at: $BUILD_URL/console" + "\n"
)
}