Skip to content

Instantly share code, notes, and snippets.

@kyanny
Created November 5, 2012 15:14
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kyanny/4017686 to your computer and use it in GitHub Desktop.
Save kyanny/4017686 to your computer and use it in GitHub Desktop.
#!/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
#!/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
#!/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
#!/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