Skip to content
This repository has been archived by the owner on May 29, 2024. It is now read-only.

Commit

Permalink
fix(ci): Slack notification should now have a version in it
Browse files Browse the repository at this point in the history
  • Loading branch information
jftanner committed Dec 24, 2018
1 parent e355a7a commit 441c0f7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,16 @@ pipeline {
sh 'npx semantic-release'
}
sh 'cat CHANGELOG.md'
sh 'node -p "require(\'./package.json\').version || \'unreleased\'" > env.RELEASED_VERSION'
sh "echo Version: ${RELEASED_VERSION}"
}
}

stage('Deploy') {
when {
branch 'master'
not {
environment name: RELEASED_VERSION, value: 'unreleased'
}
}
steps {
script {
Expand All @@ -70,14 +74,14 @@ pipeline {
sh 'ssh docker.tanndev.com "cd maelstrom && docker-compose up -d"'
}
}
slackSend channel: '#maelstrom', color: 'good', message: 'Successfully published <https://maelstrom.tanndev.com|Maelstrom App>.'
slackSend channel: '#maelstrom', color: 'good', message: "Successfully published <https://maelstrom.tanndev.com|Maelstrom> v${RELEASED_VERSION}."
}
}
}

post {
failure {
slackSend channel: '#maelstrom', color: 'danger', message: "Failed to build/publish Maelstrom App. (<${env.JOB_URL}|Pipeline>) (<${env.BUILD_URL}console|Console>)"
slackSend channel: '#maelstrom', color: 'danger', message: "Failed to build/publish Maelstrom. (<${env.JOB_URL}|Pipeline>) (<${env.BUILD_URL}console|Console>)"
}
}
}

0 comments on commit 441c0f7

Please sign in to comment.