SlideShare ist ein Scribd-Unternehmen logo
1 von 32
Downloaden Sie, um offline zu lesen
AUTOMATED RELEASES TO
RUBYGEMS USING TRAVISCI
By Francis Luong (Franco)
@FRANCISLUONG (FRANCO)
➤ Infrastructure developer 

for salesforce.com
➤ Core Focus: 

Software for Networks
➤ Previous Team: Ruby 

(but not Rails)
SHOW OF HANDS
Published a Gem?
Used Travis?
MY MOTIVATION
Publish my first Ruby Gem - Honor TCL/Expect
I’m Lazy
Free Servers/Services
Are Amazing!
LET’S BEGIN!
INGREDIENTS
➤ RubyGems Account
➤ Travis-CI.org Account
➤ hooked up to your Github account via OAuth
➤ Github Ruby repo
➤ that you own (or for an Org)
➤ must be Public
STEP 1: CURL
YOUR
RUBYGEMS
API KEY
~/.gem/credentials
STEP 1: RUBYGEMS API KEY
➤ Inputs:
➤ USERNAME: your rubygems username
➤ curl prompts you for password
➤ curl -u ${USERNAME} https://rubygems.org/api/
v1/api_key.yaml > ~/.gem/credentials
➤ chmod 0600 ~/.gem/credentials
STEP 2: GET
TRAVIS
WORKING
https://docs.travis-ci.com/user/getting-started/
.TRAVIS.YML - BASIC VERSION
language: ruby

rvm:

- 2.2.0

- 2.0.0
install:

- bundle install
script:

- uname -s

- rake test
PRO TIP: USE THE TRAVIS GEM TO ADD RUBYGEMS DEPLOY
$ travis setup rubygems [-—force]
Gem name: |expect-behaviors|
Release only tagged commits? |yes|
Release only from francisluong/expect-behaviors? |yes|
Encrypt API key? |yes|
$
This uses the rubygems.org key from Step 1 and
encrypts it.
.TRAVIS.YML - NOW WITH DEPLOY SECTION
language: ruby

rvm:

- 2.2.0

- 2.0.0
deploy:

provider: rubygems

api_key:

secure: VThxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

gem: expect-behaviors

on:

tags: true

repo: francisluong/expect-behaviors
install:

- bundle install
script:

- uname -s

- rake test
ADD YOUR REPO TO TRAVIS IF YOU HAVEN’T ALREADY
DEMO: BUMP, GEMSPEC, AND TAG
https://travis-ci.org/francisluong/expect-behaviors
https://github.com/francisluong/expect-behaviors/releases
STEP 3: USE
JEWELER OR
JUWELIER
Bump Version and Generate
Gemspec via Rake Tasks
"Juwelier" is
pronounced
"you-ve-LEER"
“GemSpec files are a pain in the
bottom!
-Franco
JEWELER: RAKE TO FULLY GENERATE GEMSPEC FILE
require 'jeweler'



Jeweler::Tasks.new do |gem|

# gem is a Gem::Specification...
# see http://guides.rubygems.org/specification-reference/
# for more options

gem.name = "expect-behaviors"

gem.homepage = "http://github.com/francisluong/expect-
behaviors"

gem.license = "MIT"

gem.summary = %Q{Ruby Mixin to add Expect Behaviors}

gem.description = %Q{Ruby Mixin to add Expect Behaviors to
SSH/Serial/Telnet controllers}

gem.email = “XXXXXXXXXX@YYYYYYYYYY.com”

gem.authors = ["Francis Luong (Franco)"]

# dependencies defined in Gemfile

end

Jeweler::RubygemsDotOrgTasks.new
JEWELER
➤ Note: It’s in maintenance-only, so prefer Juwelier for new
projects. Same maintainer.
➤ Bump Version
➤ rake version:bump:patch
➤ rake version:bump:minor
➤ rake version:bump:major
➤ Generate Gemspec file
➤ rake gemspec
DEVELOPMENT AND RELEASE FLOW
:)
BRANCH -> PR -> MERGE - AS PER USUAL
2 STEPS TO RELEASE
➤ Preconditions: Master is in a good state for release
1. Commit a Version Bump and Gemspec. Push.
2. Create a Release Tag on Github 





Travis responds to this by attempting a test/build/
deploy after testing
BONUS: CODE
CLIMATE
Coverage and Quality
CODECLIMATE IS ALSO FREE FOR OPEN-SOURCE
➤ You can sign up using your Github login
➤ And then just add your repo
THE CODE CLIMATE REPO TOKEN IS HARD TO FIND
BUT ONCE YOU KNOW WHERE IT IS…
YOU CAN ALSO ADD THIS TO YOUR TRAVIS YAML
language: ruby

rvm:

- 2.2.0

- 2.0.0
deploy:

provider: rubygems

api_key:

secure: VThxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

gem: expect-behaviors

on:

tags: true

repo: francisluong/expect-behaviors
install:

- bundle install
script:

- uname -s

- rake test
addons:

code_climate:

repo_token: da6828XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
THEN ADD MORE BUTTONS TO YOUR README.MD
DEMO WRAP UP!
QUESTIONS
THANK YOU!
@francisluong
RESOURCES
➤ http://www.francisluong.com/blog-network-automation/
2016/3/13/travis-ruby-gems
➤ https://rubygems.org/gems/expect-behaviors
➤ https://travis-ci.org/francisluong/expect-behaviors
➤ https://github.com/francisluong/expect-behaviors/releases
➤ Jeweler and Juwelier
➤ https://github.com/technicalpickles/jeweler
➤ https://github.com/flajann2/juwelier
➤ https://codeclimate.com/github/francisluong/expect-
behaviors

Weitere ähnliche Inhalte

Was ist angesagt?

Integration Test Cucumber + Webrat + Selenium
Integration Test Cucumber + Webrat + SeleniumIntegration Test Cucumber + Webrat + Selenium
Integration Test Cucumber + Webrat + Selenium
tka
 

Was ist angesagt? (20)

Testing MeteorJS using CasperJS
Testing MeteorJS using CasperJSTesting MeteorJS using CasperJS
Testing MeteorJS using CasperJS
 
meet.php #11 - Huston, we have an airbrake
meet.php #11 - Huston, we have an airbrakemeet.php #11 - Huston, we have an airbrake
meet.php #11 - Huston, we have an airbrake
 
10 Laravel packages everyone should know
10 Laravel packages everyone should know10 Laravel packages everyone should know
10 Laravel packages everyone should know
 
Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1Laravel Beginners Tutorial 1
Laravel Beginners Tutorial 1
 
DevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: VagrantDevOps Hackathon - Session 1: Vagrant
DevOps Hackathon - Session 1: Vagrant
 
Vagrant
VagrantVagrant
Vagrant
 
Presentation laravel 5 4
Presentation laravel 5 4Presentation laravel 5 4
Presentation laravel 5 4
 
How composer saved PHP
How composer saved PHPHow composer saved PHP
How composer saved PHP
 
Symfony ile Gelişmiş API Mimarisi
Symfony ile Gelişmiş API MimarisiSymfony ile Gelişmiş API Mimarisi
Symfony ile Gelişmiş API Mimarisi
 
Integration Test Cucumber + Webrat + Selenium
Integration Test Cucumber + Webrat + SeleniumIntegration Test Cucumber + Webrat + Selenium
Integration Test Cucumber + Webrat + Selenium
 
CPAN Dependency Heaven
CPAN Dependency HeavenCPAN Dependency Heaven
CPAN Dependency Heaven
 
KAK Etkinliği OJS de Symfony kullanımı
KAK Etkinliği OJS de Symfony kullanımıKAK Etkinliği OJS de Symfony kullanımı
KAK Etkinliği OJS de Symfony kullanımı
 
php[world] 2015 Training - Laravel from the Ground Up
php[world] 2015 Training - Laravel from the Ground Upphp[world] 2015 Training - Laravel from the Ground Up
php[world] 2015 Training - Laravel from the Ground Up
 
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloudphp[world] 2015 Laravel 5.1: From Homestead to the Cloud
php[world] 2015 Laravel 5.1: From Homestead to the Cloud
 
Magento 2 Capistrano Deploy
Magento 2 Capistrano DeployMagento 2 Capistrano Deploy
Magento 2 Capistrano Deploy
 
Tdc 2013 - Ecossistema Ruby
Tdc 2013 - Ecossistema RubyTdc 2013 - Ecossistema Ruby
Tdc 2013 - Ecossistema Ruby
 
Migrating a large code-base to containers by Doug Johnson and Jonathan Lozins...
Migrating a large code-base to containers by Doug Johnson and Jonathan Lozins...Migrating a large code-base to containers by Doug Johnson and Jonathan Lozins...
Migrating a large code-base to containers by Doug Johnson and Jonathan Lozins...
 
Server Side Swift - AppBuilders 2017
Server Side Swift - AppBuilders 2017Server Side Swift - AppBuilders 2017
Server Side Swift - AppBuilders 2017
 
Laravel for Web Artisans
Laravel for Web ArtisansLaravel for Web Artisans
Laravel for Web Artisans
 
DevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of ChefDevOps hackathon Session 2: Basics of Chef
DevOps hackathon Session 2: Basics of Chef
 

Ähnlich wie Automated Releases to RubyGems.org using Travis-CI.org

Ruby 1.9 And Rails 3.0
Ruby 1.9 And Rails 3.0Ruby 1.9 And Rails 3.0
Ruby 1.9 And Rails 3.0
ArrrrCamp
 
Openshift: Deployments for the rest of us
Openshift: Deployments for the rest of usOpenshift: Deployments for the rest of us
Openshift: Deployments for the rest of us
Anurag Patel
 

Ähnlich wie Automated Releases to RubyGems.org using Travis-CI.org (20)

Gem That (2009)
Gem That (2009)Gem That (2009)
Gem That (2009)
 
Sprockets
SprocketsSprockets
Sprockets
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
 
Lessons Learnt in 2009
Lessons Learnt in 2009Lessons Learnt in 2009
Lessons Learnt in 2009
 
Rails onCpanel
Rails onCpanelRails onCpanel
Rails onCpanel
 
Ruby 1.9 And Rails 3.0
Ruby 1.9 And Rails 3.0Ruby 1.9 And Rails 3.0
Ruby 1.9 And Rails 3.0
 
Lightning branches at RedMart (Js conf Asia 2014 Talk)
Lightning branches at RedMart (Js conf Asia 2014  Talk)Lightning branches at RedMart (Js conf Asia 2014  Talk)
Lightning branches at RedMart (Js conf Asia 2014 Talk)
 
11 Ruby Gems
11 Ruby Gems11 Ruby Gems
11 Ruby Gems
 
What's new in RubyGems3
What's new in RubyGems3What's new in RubyGems3
What's new in RubyGems3
 
The Future of Dependency Management for Ruby
The Future of Dependency Management for RubyThe Future of Dependency Management for Ruby
The Future of Dependency Management for Ruby
 
ZendCon 2015 - DevOps for Small Teams
ZendCon 2015 - DevOps for Small TeamsZendCon 2015 - DevOps for Small Teams
ZendCon 2015 - DevOps for Small Teams
 
Madison PHP 2015 - DevOps For Small Teams
Madison PHP 2015 - DevOps For Small TeamsMadison PHP 2015 - DevOps For Small Teams
Madison PHP 2015 - DevOps For Small Teams
 
The Future of library dependency manageement of Ruby
The Future of library dependency manageement of RubyThe Future of library dependency manageement of Ruby
The Future of library dependency manageement of Ruby
 
How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the world
 
Apache Whirr
Apache WhirrApache Whirr
Apache Whirr
 
Rush, a shell that will yield to you
Rush, a shell that will yield to youRush, a shell that will yield to you
Rush, a shell that will yield to you
 
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
Strangers In The Night: Ruby, Rack y Sinatra - Herramientas potentes para con...
 
Openshift: Deployments for the rest of us
Openshift: Deployments for the rest of usOpenshift: Deployments for the rest of us
Openshift: Deployments for the rest of us
 
Debugging Network Issues
Debugging Network IssuesDebugging Network Issues
Debugging Network Issues
 
How to distribute Ruby to the world
How to distribute Ruby to the worldHow to distribute Ruby to the world
How to distribute Ruby to the world
 

Kürzlich hochgeladen

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Kürzlich hochgeladen (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 

Automated Releases to RubyGems.org using Travis-CI.org

  • 1. AUTOMATED RELEASES TO RUBYGEMS USING TRAVISCI By Francis Luong (Franco)
  • 2. @FRANCISLUONG (FRANCO) ➤ Infrastructure developer 
 for salesforce.com ➤ Core Focus: 
 Software for Networks ➤ Previous Team: Ruby 
 (but not Rails)
  • 3. SHOW OF HANDS Published a Gem? Used Travis?
  • 4. MY MOTIVATION Publish my first Ruby Gem - Honor TCL/Expect
  • 7. INGREDIENTS ➤ RubyGems Account ➤ Travis-CI.org Account ➤ hooked up to your Github account via OAuth ➤ Github Ruby repo ➤ that you own (or for an Org) ➤ must be Public
  • 8. STEP 1: CURL YOUR RUBYGEMS API KEY ~/.gem/credentials
  • 9. STEP 1: RUBYGEMS API KEY ➤ Inputs: ➤ USERNAME: your rubygems username ➤ curl prompts you for password ➤ curl -u ${USERNAME} https://rubygems.org/api/ v1/api_key.yaml > ~/.gem/credentials ➤ chmod 0600 ~/.gem/credentials
  • 11. .TRAVIS.YML - BASIC VERSION language: ruby
 rvm:
 - 2.2.0
 - 2.0.0 install:
 - bundle install script:
 - uname -s
 - rake test
  • 12. PRO TIP: USE THE TRAVIS GEM TO ADD RUBYGEMS DEPLOY $ travis setup rubygems [-—force] Gem name: |expect-behaviors| Release only tagged commits? |yes| Release only from francisluong/expect-behaviors? |yes| Encrypt API key? |yes| $ This uses the rubygems.org key from Step 1 and encrypts it.
  • 13. .TRAVIS.YML - NOW WITH DEPLOY SECTION language: ruby
 rvm:
 - 2.2.0
 - 2.0.0 deploy:
 provider: rubygems
 api_key:
 secure: VThxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 gem: expect-behaviors
 on:
 tags: true
 repo: francisluong/expect-behaviors install:
 - bundle install script:
 - uname -s
 - rake test
  • 14. ADD YOUR REPO TO TRAVIS IF YOU HAVEN’T ALREADY
  • 15. DEMO: BUMP, GEMSPEC, AND TAG https://travis-ci.org/francisluong/expect-behaviors https://github.com/francisluong/expect-behaviors/releases
  • 16. STEP 3: USE JEWELER OR JUWELIER Bump Version and Generate Gemspec via Rake Tasks "Juwelier" is pronounced "you-ve-LEER"
  • 17. “GemSpec files are a pain in the bottom! -Franco
  • 18. JEWELER: RAKE TO FULLY GENERATE GEMSPEC FILE require 'jeweler'
 
 Jeweler::Tasks.new do |gem|
 # gem is a Gem::Specification... # see http://guides.rubygems.org/specification-reference/ # for more options
 gem.name = "expect-behaviors"
 gem.homepage = "http://github.com/francisluong/expect- behaviors"
 gem.license = "MIT"
 gem.summary = %Q{Ruby Mixin to add Expect Behaviors}
 gem.description = %Q{Ruby Mixin to add Expect Behaviors to SSH/Serial/Telnet controllers}
 gem.email = “XXXXXXXXXX@YYYYYYYYYY.com”
 gem.authors = ["Francis Luong (Franco)"]
 # dependencies defined in Gemfile
 end
 Jeweler::RubygemsDotOrgTasks.new
  • 19. JEWELER ➤ Note: It’s in maintenance-only, so prefer Juwelier for new projects. Same maintainer. ➤ Bump Version ➤ rake version:bump:patch ➤ rake version:bump:minor ➤ rake version:bump:major ➤ Generate Gemspec file ➤ rake gemspec
  • 21. BRANCH -> PR -> MERGE - AS PER USUAL
  • 22. 2 STEPS TO RELEASE ➤ Preconditions: Master is in a good state for release 1. Commit a Version Bump and Gemspec. Push. 2. Create a Release Tag on Github 
 
 
 Travis responds to this by attempting a test/build/ deploy after testing
  • 24. CODECLIMATE IS ALSO FREE FOR OPEN-SOURCE ➤ You can sign up using your Github login ➤ And then just add your repo
  • 25. THE CODE CLIMATE REPO TOKEN IS HARD TO FIND
  • 26. BUT ONCE YOU KNOW WHERE IT IS…
  • 27. YOU CAN ALSO ADD THIS TO YOUR TRAVIS YAML language: ruby
 rvm:
 - 2.2.0
 - 2.0.0 deploy:
 provider: rubygems
 api_key:
 secure: VThxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 gem: expect-behaviors
 on:
 tags: true
 repo: francisluong/expect-behaviors install:
 - bundle install script:
 - uname -s
 - rake test addons:
 code_climate:
 repo_token: da6828XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  • 28. THEN ADD MORE BUTTONS TO YOUR README.MD
  • 32. RESOURCES ➤ http://www.francisluong.com/blog-network-automation/ 2016/3/13/travis-ruby-gems ➤ https://rubygems.org/gems/expect-behaviors ➤ https://travis-ci.org/francisluong/expect-behaviors ➤ https://github.com/francisluong/expect-behaviors/releases ➤ Jeweler and Juwelier ➤ https://github.com/technicalpickles/jeweler ➤ https://github.com/flajann2/juwelier ➤ https://codeclimate.com/github/francisluong/expect- behaviors