diff --git a/Jenkinsfile b/Jenkinsfile index 1f2d94b71feadc76e91f917b1d973dc027cb62f0..d9dd54db7aba8cd66f4a5d00ee32f7ba495efe9a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,81 +1,44 @@ pipeline { - - agent any - - stages { - - stage('Prepare') { - - agent any - - steps { - - checkout scm - - } - - post { - - success { - - echo 'prepare success' - - } - - always { - - echo 'done prepare' - - } - - cleanup { - - echo 'after all other post conditions' - + agent any + environment { + userId = "KYH" + } + stages { + stage('Prepare'){ + agent any + steps { + checkout scm + } + }post { + success{ + echo 'prepare success' + } + always{ + echo 'done prepare' + slackSend (channel: '#devops', color: '#FFFF00'), + message: "${env.userId}" STARTED:Job '${env.JOB_NAME}' [$(env.BUILD_NUMBER)](${env.BUILD_URL}) + } + cleanup{ + echo 'after all other post conditions' + } } - - } - } - - - -pipeline { - - agent any - - stages { - - stage('Prepare') { - - agent any - - steps { - - checkout scm - - } - - post { - - success { - - echo 'prepare success' - + stage('maven build'){ + steps { + sh 'mvn package' } - - always { - - echo 'done prepare' - + post { + success{ + echo 'maven build success' + } + always{ + echo 'done maven build' + slackSend (channel: '#devops', color: '#FFFF00'), + message: "${env.userId}" STARTED:Job '${env.JOB_NAME}' [$(env.BUILD_NUMBER)](${env.BUILD_URL}) + } } - - cleanup { - - echo 'after all other post conditions' - + failure { + echo 'maven build failed' } - - } - - } \ No newline at end of file + } +} \ No newline at end of file