Engine Yard CloudにJenkinsをのせる

概要

Engine Yard CloudにCustom Chef RecipeをつかってCI server Jenkinsを簡単にインストールすることができます。

(一台のサーバにインストールするため可用性を高めることはできません。)

手順

1. 空のRailsアプリケーションを作成します

以下のGitリポジトリを使って、ダミーのRackアプリケーションを設定します。

 https://github.com/engineyard/ey-jenkins-app

 

2. Custom Configurationをつかって、一台Appサーバを作成します。

サイズはどのサイズでも動かすことができます。用途に応じたサイズをお選びください。

 __________2013-09-13_2.20.58_PM-2.png

3. 上記設定でサーバをBootします。

 

4. ey-cloud recipeをローカル環境にclone(or ダウンロード)してきます。

https://github.com/engineyard/ey-cloud-recipes

$git clone cookbooks/main/recipes/default.rb

 

5. jenkinsのレシピを有効にします

ローカル環境でey-cloud-recipes/内のcookbooks/main/recipes/default.rbを編集します。

include_recipe "jenkins" の行がコメントアウトされているので、コメントインします。

$cd ey-cloud-recieps
$vi cookbooks/main/recipes/default.rb

 cookbooks/main/recipes/default.rbの以下の行を編集

include_recipe "jenkins"  #この行をコメントイン

 

6. 該当のアカウントにログインし、recipeのuploadとapplyをします

$ey login
$ey recipes upload -e ey_jenkins
$ey recipes apply -e ey_jenkins

 

7. インスタンスのHost名/jenkinsにアクセスします

http://ec2-54-xxx-xxx-xx.ap-northeast-1.compute.amazonaws.com/jenkins/

__________2013-09-13_4.32.09_PM.png 

トラブルシューティング

アクセスしても503

jettyのプロセスが立ち上がってない可能性があります。インスタンスにログイン、またはey sshからプロセスの起動を行って下さい。

$ey ssh

# ログイン
$sudo /etc/init.d/jetty start

 

$ey ssh 'sudo /etc/init.d/jetty start'

 

capybara-webkitのinstallエラーが出る

Command 'qmake -spec linux-g++' not available 

上記のエラーが出る場合は、以下のドキュメントに従って、"libs/qt-webkit"をインストールしてください。

https://support.cloud.engineyard.com/entries/26199828

 

Jenkinsでbundlerの実行ができない

該当インスタンスに以下のコマンドでbundlerをインストールしてください。

$sudo gem install bundler 

参考

英語版のドキュメント

https://github.com/engineyard/ey-cloud-recipes/tree/master/cookbooks/jenkins

コメント

サインインしてコメントを残してください。

Powered by Zendesk