Jenkins and rails app - Le Dinh Vu

1,738 views
1,459 views

Published on

Published in: Technology
1 Comment
1 Like
Statistics
Notes
No Downloads
Views
Total views
1,738
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
7
Comments
1
Likes
1
Embeds 0
No embeds

No notes for slide

Jenkins and rails app - Le Dinh Vu

  1. 1. Jenkins and Rails app
  2. 2. Agenda 1. Install Jenkins on Ubuntu 2. Install Ruby using RVM 3. Install needed Jenkins Plugins 4. Install needed Gems 5. How Jenkins works 6. Demo
  3. 3. Install Jenkins on Ubuntu # Install sudo apt-get install jenkins #-> Home: /var/lib/jenkins # Start service sudo service jenkins start Default Jenkins URL (localhost): 0.0.0.0:8080
  4. 4. Install Ruby using RVM 1. Install RVM, Ruby and Rails # Install requirements (as root user) sudo apt-get --no-install-recommends install build-essential openssl nodejs libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev gawk libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison subversion pkg-config libffi-dev 2. Install RVM and Ruby for Jenkins user sudo su - jenkins # install RVMcurl -L https://get.rvm.io | bash -s stable # Make "rvm" as command echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm' >> ~/.bashrc # Install Ruby and Rails rvm install 1.9.3 && gem install rails
  5. 5. Install needed Jenkins' plugins GitHub API Plugin This plugin provides GitHub API for other plugins. GitHub plugin This plugin integrates GitHub to Jenkins. Github Pull Request Builder This plugin builds pull requests in github and report results. Jenkins GIT plugin This plugin integrates GIT with Jenkins. Jenkins Rake plugin The Rake plugin allows to execute rake task from Jenkins. Jenkins ruby metrics plugin This plugin integrates a bunch of ruby coverage tools (Rcov, Saikuro, Rails stats...) to Jenkins. Currently it just supports Rcov reports.
  6. 6. Install needed Jenkins' plugins GitHub API Plugin This plugin provides GitHub API for other plugins. GitHub plugin This plugin integrates GitHub to Jenkins. Github Pull Request Builder This plugin builds pull requests in github and report results. Jenkins GIT plugin This plugin integrates GIT with Jenkins. Jenkins Rake plugin The Rake plugin allows to execute rake task from Jenkins. Jenkins ruby metrics plugin This plugin integrates a bunch of ruby coverage tools (Rcov, Saikuro, Rails stats...) to Jenkins. Currently it just supports Rcov reports.
  7. 7. Needed Gems # Gemfile group :test do gem 'rspec-rails' gem 'guard-rspec' gem 'shoulda-matchers' gem 'rb-inotify', '~> 0.9' gem 'factory_girl_rails' gem 'simplecov' gem 'simplecov-rcov' gem 'ci_reporter', '1.8.0' end # spec/spec_helper.rb require 'simplecov' require 'simplecov-rcov' SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter SimpleCov.start
  8. 8. How it works
  9. 9. Demo • Adding new Github project • Configuring build • Building project • Checking results • Using Github pull request builder • Using Github service hook * Note: For private github project, need to remove pass phase from ssh key.
  10. 10. Links and References https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+Ubuntu https://github.com/nicksieger/ci_reporter https://github.com/janinko/ghprb https://help.github.com/articles/post-receive-hooks
  11. 11. Thank you for listening.

×