spec/_role以下にspecファイルを分離してみた.
$ tree spec/
spec/
├── _role
│ ├── cloudforecast_spec.rb
│ ├── growthforecast_spec.rb
| # using ruby 2.0.0-p247 | |
| rbenv local 2.0.0-p247 | |
| # install fluentd | |
| echo 'source "https://rubygems.org" | |
| gem "fluentd"' > Gemfile | |
| bundle install --path=bundle | |
| # create fluent.conf | |
| echo '<source> |
| class AHelper | |
| def render_ul arg | |
| unless arg.nil? or arg.empty? | |
| "<ul>#{render arg}</ul>".html_safe | |
| else | |
| "" | |
| end | |
| end | |
| end |
Commandクラスにby_userメソッドを追加してみる.
module Serverspec
module Type
class Command
def by_user(user)
self.class.new("su -l '#{user}' -c '#{@name}'")
end
endビルドの実行、アーカイブ、ジョブなど実行後に書き込みされるファイルのディレクトリ. デフォルトでは~/.jenkins.
https://wiki.jenkins-ci.org/display/JA/Administering+Jenkins
Tomcatでの設定例は公式ドキュメントを参考に.
https://wiki.jenkins-ci.org/display/JENKINS/Tomcat#Tomcat-SettingJENKINSHOME
| #!/bin/sh | |
| # | |
| # mapi-on-rails - this script starts and stops the unicorn_rails daemon for mapi-on-rails | |
| # | |
| # chkconfig: - 90 10 | |
| # description: unicorn_rails for mapi-on-rails | |
| # Source function library. | |
| . /etc/rc.d/init.d/functions |
gemインストール.
$ gem install chef
$ gem install knife-solovagrantの秘密鍵設定しておく. やっておかないとknife solo cookした時にrsyncで都度パスワード入力求められる.
| if [ -n "$(ruby --version|grep 'ruby 1.8')" ]; then | |
| # yum settings | |
| rpm --import http://ftp.riken.jp/Linux/fedora/epel/RPM-GPG-KEY-EPEL-6 | |
| rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm | |
| # install dependencies to compile ruby | |
| yum install -y zlib-devel openssl-devel readline-devel ncurses-devel gdbm-devel db4-devel libffi-devel tk-devel libyaml-devel | |
| # uninstall system ruby 1.8.x | |
| yum -y erase rubygems.noarch |