Created
November 5, 2012 15:14
-
-
Save kyanny/4017686 to your computer and use it in GitHub Desktop.
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
#!/var/lib/jenkins/.rvm/bin/rvm-shell ruby-1.9.3-p194@sqale | |
export RAILS_ENV=test | |
bundle install --without production | |
git checkout -b feature/bundle-update-`date +%Y%m%d` | |
bundle update | |
git add Gemfile Gemfile.lock | |
git commit -m 'bundle update' | |
git push origin feature/bundle-update-`date +%Y%m%d` | |
rake db:create db:migrate | |
COVERAGE=on rake ci:setup:rspec spec | |
exitstatus=$? | |
rake db:drop | |
git checkout develop | |
exit $exitstatus |
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
#!/bin/sh | |
MY_BRANCH="feature/bundle-update-`date +%Y%m%d`" | |
git checkout develop | |
git pull | |
bundle install --without production | |
/var/lib/jenkins/bin/hub fork | |
git branch $MY_BRANCH | |
git checkout $MY_BRANCH | |
bundle update | |
git add Gemfile Gemfile.lock | |
git commit -m 'bundle update' | |
export RAILS_ENV=test | |
rake db:create db:migrate | |
COVERAGE=on rake ci:setup:rspec spec | |
exitstatus=$? | |
rake db:drop | |
git push sqale $MY_BRANCH | |
git checkout develop | |
exit $exitstatus |
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
#!/var/lib/jenkins/.rvm/bin/rvm-shell ruby-1.9.3-p194@sqale | |
# BUILD 結果を取得 (色なし) | |
RESULT=`curl ${BUILD_URL}api/xml | perl -le '$_=<>;/<result>(.+?)</;printf $1'` | |
# GitHub に pull-request する | |
#/var/lib/jenkins/bin/hub pull-request "bundle update `date +%Y%m%d` Build: $RESULT" -h paperboy-sqale:feature/bundle-update-`date +%Y%m%d` -b paperboy-sqale:develop --body "build status: $RESULT¥nURL: $ $BUILD_URL" | |
# 本当は↑のように pull-request 時に body コメントもつけたいが hub はコマンドラインからは body を入力できないので | |
# とりあえず↓のようにする。取り込まれないと思うけど PR だけ出してみた。https://github.com/defunkt/hub/pull/256 | |
/var/lib/jenkins/bin/hub pull-request "bundle update `date +%Y%m%d` Build: $RESULT" -h paperboy-sqale:feature/bundle-update-`date +%Y%m%d` -b paperboy-sqale:develop |
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
#!/bin/sh | |
# BUILD 結果を取得 (色なし) | |
RESULT=`curl ${BUILD_URL}api/xml | perl -le '$_=<>;/<result>(.+?)</;printf $1'` | |
# GitHub に pull-request する | |
#/var/lib/jenkins/bin/hub pull-request "bundle update `date +%Y%m%d` Build: $RESULT" -h paperboy-sqale:feature/bundle-update-`date +%Y%m%d` -b paperboy-sqale:develop --body "build status: $RESULT¥nURL: $ $BUILD_URL" | |
# 本当は↑のように pull-request 時に body コメントもつけたいが hub はコマンドラインからは body を入力できないので | |
# とりあえず↓のようにする。取り込まれないと思うけど PR だけ出してみた。https://github.com/defunkt/hub/pull/256 | |
/var/lib/jenkins/bin/hub pull-request "bundle update `date +%Y%m%d` Build: $RESULT" -b paperboy-sqale:develop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment