Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Deploy after build stage and notify GitHub.
Browse files Browse the repository at this point in the history
Move test deployment so that it happens right after the "Build nano"
stage and notify GitHub status API with custom context.
  • Loading branch information
francoilol committed Oct 11, 2017
1 parent 7e0fd61 commit c8b517c
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,16 @@ node('lisk-nano') {
}
}

stage ('Deploy') {
try {
sh 'rsync -axl --delete --rsync-path="mkdir -p /var/www/test/lisk-nano/$BRANCH_NAME/ && rsync" $WORKSPACE/app/dist/ jenkins@master-01:/var/www/test/lisk-nano/$BRANCH_NAME/'
githubNotify context: 'Jenkins test deployment', description: 'Commit was deployed to test', status: 'SUCCESS', targetUrl: "https://${HUDSON_URL}/test/lisk-nano/${BRANCH_NAME}"
} catch (err) {
echo "Error: ${err}"
fail('Stopping build: deploy failed')
}
}

stage ('Run Unit Tests') {
try {
ansiColor('xterm') {
Expand Down Expand Up @@ -111,15 +121,6 @@ node('lisk-nano') {
fail('Stopping build: end-to-end test suite failed')
}
}

stage ('Deploy') {
try {
sh 'rsync -axl --delete --rsync-path="mkdir -p /var/www/test/lisk-nano/$BRANCH_NAME/ && rsync" $WORKSPACE/app/dist/ jenkins@master-01:/var/www/test/lisk-nano/$BRANCH_NAME/'
} catch (err) {
echo "Error: ${err}"
fail('Stopping build: deploy failed')
}
}
} catch(err) {
echo "Error: ${err}"
} finally {
Expand Down

0 comments on commit c8b517c

Please sign in to comment.