Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pipeline {
- options {
- timeout(time: 1, unit: 'HOURS')
- retry(1)
- timestamps()
- }
- agent any
- environment {
- slack_channel = 'test-jenkins'
- color_green = '#21c431'
- color_red = '#c42121'
- }
- stages {
- stage('Get Lokalise') {
- steps {
- sh 'curl ...'
- sh '...'
- sh '...'
- }
- }
- stage('Deploy to integration') {
- when {
- expression { BRANCH_NAME ==~ /(uat)/ }
- }
- steps {
- echo 'experimental automatic deploy..'
- sh '...'
- echo 'add version.txt file with deployed hash'
- sh 'cd ... && git rev-parse HEAD > dist/version.txt'
- }
- post {
- success{
- slackSend (color: "${env.color_green}", message: "Deployed: Branch '${env.GIT_BRANCH} (hash: ${env.GIT_COMMIT})", channel: "${env.slack_channel}")
- }
- failure {
- slackSend (color: "${env.color_red}", message: "Deployment failed: Branch '${env.GIT_BRANCH} (${env.BUILD_URL})", channel: "${env.slack_channel}")
- }
- }
- }
- stage('Deploy to pre-production') {
- when {
- expression { BRANCH_NAME ==~ /(develop)/ }
- }
- steps {
- echo 'experimental automatic deploy..'
- sh '...'
- }
- post {
- success {
- slackSend (color: "${env.color_green}", message: "Deployed: Branch '${env.GIT_BRANCH} (hash: ${env.GIT_COMMIT})", channel: "${env.slack_channel}")
- }
- failure {
- slackSend (color: "${env.color_red}", message: "Deployment failed: Branch '${env.GIT_BRANCH} (${env.BUILD_URL})", channel: "${env.slack_channel}")
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment