Created
April 10, 2018 15:18
-
-
Save dvigne/843cca88248622f31543de5a4932fa22 to your computer and use it in GitHub Desktop.
Jenkinsfile Boilerplate Template
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
pipeline { | |
agent any | |
environment { | |
GIT_NAME = sh returnStdout: true, script: "git --no-pager show -s --format='%an' ${env.GIT_COMMIT}" | |
} | |
stages { | |
stage(build) { | |
steps { | |
slackSend channel: '#builds', color: 'good', message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} Started by changes from ${env.GIT_NAME}(<${env.BUILD_URL}|Open>)", teamDomain: 'teamnamehere', tokenCredentialId: 'tokenidhere' | |
} | |
} | |
stage(test) { | |
steps { | |
} | |
} | |
} | |
post { | |
always { | |
junit "tests/phpunit.xml" | |
deleteDir() | |
} | |
success { | |
slackSend channel: '#builds', color: 'good', message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} Success after ${currentBuild.durationString}(<${env.BUILD_URL}|Open>)", teamDomain: 'teamnamehere', tokenCredentialId: 'tokenidhere' | |
} | |
failure { | |
slackSend channel: '#builds', color: 'danger', message: "${env.JOB_NAME} - #${env.BUILD_NUMBER} Failure after ${currentBuild.durationString}(<${env.BUILD_URL}|Open>)", teamDomain: 'teamnamehere', tokenCredentialId: 'tokenidhere' | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment