curl -u Jenkins:Jenkins -H "Content-Type: application/json" -X POST http://localhost:7990/rest/build-status/1.0/commits/$GIT_COMMIT -d '{"state":"INPROGRESS","key": "'$BUILD_TAG'","name": "Jenkins-'$BUILD_DISPLAY_NAME'", "url": "'$BUILD_URL'/consoleText","description": "Changes by '$GIT_COMMITTER_EMAIL'"}'
#!/bin/sh
cd ${WORKSPACE}
SUCCESS=true
gem install bundler --no-rdoc --no-ri || SUCCESS=false
bundle install || SUCCESS=false
bundle exec rake db:create || SUCCESS=false
bundle exec rake db:migrate RAILS_ENV=test || SUCCESS=false
bundle exec rails test || SUCCESS=false
if $SUCCESS; then
curl -u Jenkins:Jenkins -H "Content-Type: application/json" -X POST http://localhost:7990/rest/build-status/1.0/commits/$GIT_COMMIT -d '{"state":"SUCCESSFUL","key": "'$BUILD_TAG'","name": "Jenkins-'$BUILD_DISPLAY_NAME'", "url": "'$BUILD_URL'/consoleText","description": "Changes by '$GIT_COMMITTER_EMAIL'"}';
else
curl -u Jenkins:Jenkins -H "Content-Type: application/json" -X POST http://localhost:7990/rest/build-status/1.0/commits/$GIT_COMMIT -d '{"state":"FAILED","key": "'$BUILD_TAG'","name": "Jenkins-'$BUILD_DISPLAY_NAME'", "url": "'$BUILD_URL'/consoleText","description": "Changes by '$GIT_COMMITTER_EMAIL'"}';
raise error "Build Failed"
fi
Last active
September 24, 2018 15:35
-
-
Save mosinski/6e101460832a24f29e5eec897fd40879 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment