-
Notifications
You must be signed in to change notification settings - Fork 494
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CICD]update jenkinsfile add slack notice, add scriptfile execute mod (…
- Loading branch information
Showing
20 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
@Library('JenkinsHelper') _ | ||
pipeline { | ||
agent any | ||
environment { | ||
PROJECT_DIR = "${WORKSPACE}/" | ||
USER_CREDENTIALS_ID = "jenkinsuser" | ||
} | ||
stages { | ||
stage('Pull') { | ||
steps { | ||
|
@@ -8,7 +13,7 @@ pipeline { | |
} | ||
stage('Pullconfig') { | ||
steps { | ||
sshPublisher failOnError: true, publishers: [sshPublisherDesc(configName: 'km05', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: 'export BUILDDIR=${HOME}/backdemo/easegateway;export CONFIGDIR=${HOME}/backdemo/easegateway-configuration;if [ ! -d ${CONFIGDIR} ];then mkdir -p ${CONFIGDIR}; cd ${CONFIGDIR}; git init; git remote add origin ssh:https://[email protected]/danfu3000/easegateway-configuration.git; fi;cd ${CONFIGDIR};GIT_SSH_COMMAND="ssh -i ../../jenkins/keys/kmtest-configuration" git pull origin km; cp *.env ${BUILDDIR}/', execTimeout: 600000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '${HOME}', remoteDirectorySDF: false, removePrefix: '', sourceFiles: '')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)] | ||
sshPublisher failOnError: true, publishers: [sshPublisherDesc(configName: 'km05', transfers: [sshTransfer(cleanRemote: false, excludes: '', execCommand: 'export BUILDDIR=${HOME}/backdemo/easegateway;export CONFIGDIR=${HOME}/backdemo/easegateway-configuration;if [ ! -d ${CONFIGDIR} ];then mkdir -p ${CONFIGDIR}; cd ${CONFIGDIR}; git init; git remote add origin ssh:https://[email protected]/danfu3000/easegateway-configuration.git; fi;cd ${CONFIGDIR};GIT_SSH_COMMAND="ssh -i ../../jenkins/keys/kmtest-configuration" git pull origin km; cp *.env ${BUILDDIR}/scripts/', execTimeout: 600000, flatten: false, makeEmptyDirs: false, noDefaultExcludes: false, patternSeparator: '[, ]+', remoteDirectory: '${HOME}', remoteDirectorySDF: false, removePrefix: '', sourceFiles: '')], usePromotionTimestamp: false, useWorkspaceInPromotion: false, verbose: false)] | ||
} | ||
} | ||
stage('Buildtest') { | ||
|
@@ -27,4 +32,21 @@ pipeline { | |
} | ||
} | ||
} | ||
post { | ||
success { | ||
script { | ||
def level = 'good' | ||
def subject = "[TASK:${env.JOB_NAME} SUCCESS]Deploy megaease/easegateway in environment:km" | ||
helper.notifySlack level, env, subject | ||
} | ||
} | ||
|
||
failure { | ||
script { | ||
def level = 'danger' | ||
def subject = "[TASK:${env.JOB_NAME} FAILED]Deploy megaease/easegateway in environment:km" | ||
helper.notifySlack level, env, subject | ||
} | ||
} | ||
} | ||
} |