Code Monkey home page Code Monkey logo

capistrano-scm-jenkins's Introduction

Capistrano::Jenkins

Build Status Gem Version Dependency Status

Allows Capistrano to treat Jenkins as an SCM, deploying artifacts from a specified job.

Installation

Add this line to your application's Gemfile:

gem 'capistrano-scm-jenkins'

And then execute:

$ bundle

Or install it yourself as:

$ gem install capistrano-scm-jenkins

Usage

In your Capfile, you’ll need to require 'capistrano-scm-jenkins.

A sample config/deploy.rb:

set :application, 'my-sweet-app'
set :repo_url, 'http://my.jenkins.install/job/my-sweet-app'
set :deploy_to, "/home/#{fetch(:user)}/#{fetch(:application)}"

# Jenkins username & password
set :jenkins_user, 'user'
set :jenkins_pass, 'pass'

# Allow the deployment of unstable versions
# set :jenkins_use_unstable, true

# Deploy from artifact subfolder. (ex: mv zipout/#{:jenkins_artifact_path} #{destination})
# set :jenkins_artifact_path, 'archive'
#
# Deploy a single file.
# set :jenkins_artifact_file, 'my-api/target/webapp.war'
#
# Deploy a specific build number
# set(:jenkins_build_number, ENV['REVISION']) if ENV['REVISION']
#
# Bypass SSL verification
# set :jenkins_insecure, true

maven module

For a Maven module, you should include the module name in the :repo_url:

set :repo_url,  "http://jenkins.example.com/job/example/com.example.helloworld$helloworld/"

Contributing

  1. Fork it ( http://github.com/jeffbyrnes/capistrano-scm-jenkins/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

LICENSE

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

capistrano-scm-jenkins's People

Contributors

agerauer avatar cynipe avatar iristyle avatar jeffbyrnes avatar lidaobing avatar lostintime avatar xsb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

capistrano-scm-jenkins's Issues

cap deploy:pending crashed with a strange title

when there is a title like account #22 (1 more test is failing (total 19)), the cap deploy:pending crashed

$ cap deploy:pending
    triggering load callbacks
  * 2013-10-28 17:00:25 executing `staging'
    triggering start callbacks for `deploy:pending'
  * 2013-10-28 17:00:25 executing `multistage:ensure'
  * 2013-10-28 17:00:25 executing `deploy:pending'
  * executing "cat /home/ubuntu/testenv/account/current/REVISION"
    servers: ["222.73.201.152"]
    [222.73.201.152] executing command
    command finished in 357ms
 ** BUILD LOG
 ** =========
 ** 2013-10-28T08:57:15Z    account #37 (stable)
/Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-scm-jenkins-0.0.6/lib/capistrano/recipes/deploy/scm/jenkins.rb:147:in `get_build_number_from_rss_all_title': undefined method `[]' for nil:NilClass (NoMethodError)
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-scm-jenkins-0.0.6/lib/capistrano/recipes/deploy/scm/jenkins.rb:104:in `block in log_build_message'
    from /Users/lidaobing/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/rexml/xpath.rb:67:in `each'
    from /Users/lidaobing/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/2.0.0/rexml/xpath.rb:67:in `each'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-scm-jenkins-0.0.6/lib/capistrano/recipes/deploy/scm/jenkins.rb:101:in `log_build_message'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-scm-jenkins-0.0.6/lib/capistrano/recipes/deploy/scm/jenkins.rb:53:in `log'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy/scm/base.rb:35:in `block in method_missing'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy/scm/base.rb:63:in `local'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy/scm/base.rb:35:in `method_missing'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.5/lib/capistrano/recipes/deploy.rb:553:in `block (3 levels) in load'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:138:in `instance_eval'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:138:in `invoke_task_directly'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.5/lib/capistrano/configuration/callbacks.rb:25:in `invoke_task_directly_with_callbacks'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:89:in `execute_task'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.5/lib/capistrano/configuration/execution.rb:101:in `find_and_execute_task'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:46:in `block in execute_requested_actions'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:45:in `each'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:45:in `execute_requested_actions'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.5/lib/capistrano/cli/help.rb:19:in `execute_requested_actions_with_help'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:34:in `execute!'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:14:in `execute'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/gems/capistrano-2.15.5/bin/cap:4:in `<top (required)>'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/bin/cap:23:in `load'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/bin/cap:23:in `<main>'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14:in `eval'
    from /Users/lidaobing/.rvm/gems/ruby-2.0.0-p195/bin/ruby_noexec_wrapper:14:in `<main>'

change repository address

@jeffbyrnes can you move this project to your space.

I am no longer using or working on this project, and i think it's a good time for you to adopt this project. so can you move this project to your space, and I can help on all the issues you met (for example, setup a redirect README on this project, etc.)

thank you

Does not support SSL

When trying to use a force-https Jenkins repo, I get the dreaded SLL verify error.

open url https://redacted.repo.com/job/jobname//rssAll failed: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

I've been trying to figure out where to drop in a path to a cacert, but with little luck.

Breaks with `sync' is not implemented by Capistrano::Deploy::SCM::Jenkins (NotImplementedError) on Capistrano 2.9.0

/usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/recipes/deploy/scm/base.rb:94:in sync':sync' is not implemented by Capistrano::Deploy::SCM::Jenkins (NotImplementedError)
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/recipes/deploy/strategy/remote_cache.rb:35:in update_repository_cache' from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/recipes/deploy/strategy/remote_cache.rb:15:indeploy!'
from /usr/local/lib/ruby/gems/1.8/gems/railsless-deploy-1.0.2/lib/railsless-deploy.rb:204
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/execution.rb:139:in instance_eval' from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/execution.rb:139:ininvoke_task_directly_without_callbacks'
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/callbacks.rb:27:in invoke_task_directly' from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/execution.rb:89:inexecute_task'
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/namespaces.rb:186:in send' from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/namespaces.rb:186:inmethod_missing'
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/namespaces.rb:104:in update_code' from /usr/local/lib/ruby/gems/1.8/gems/railsless-deploy-1.0.2/lib/railsless-deploy.rb:185 from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/execution.rb:56:intransaction'
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/namespaces.rb:186:in send' from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/namespaces.rb:186:inmethod_missing'
from /usr/local/lib/ruby/gems/1.8/gems/railsless-deploy-1.0.2/lib/railsless-deploy.rb:184
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/execution.rb:139:in instance_eval' from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/execution.rb:139:ininvoke_task_directly_without_callbacks'
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/callbacks.rb:27:in invoke_task_directly' from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/execution.rb:89:inexecute_task'
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/namespaces.rb:186:in send' from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/namespaces.rb:186:inmethod_missing'
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/namespaces.rb:104:in update' from /usr/local/lib/ruby/gems/1.8/gems/railsless-deploy-1.0.2/lib/railsless-deploy.rb:154 from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/execution.rb:139:ininstance_eval'
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/execution.rb:139:in invoke_task_directly_without_callbacks' from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/callbacks.rb:27:ininvoke_task_directly'
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/execution.rb:89:in execute_task' from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/configuration/execution.rb:101:infind_and_execute_task'
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/cli/execute.rb:46:in execute_requested_actions_without_help' from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/cli/execute.rb:45:ineach'
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/cli/execute.rb:45:in execute_requested_actions_without_help' from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/cli/help.rb:19:inexecute_requested_actions'
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/cli/execute.rb:34:in execute!' from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/lib/capistrano/cli/execute.rb:14:inexecute'
from /usr/local/lib/ruby/gems/1.8/gems/capistrano-2.9.0/bin/cap:4
from /usr/local/bin/cap:19:in `load'
from /usr/local/bin/cap:19

remove --fail in the update def

getting this error when pulling new artifact,
curl: (22) The requested URL returned error: 401 Authorization Required
I use self-sign certificates.

Can --fail be removed from update method?
context.execute :curl, "--silent --fail --show-error #{curl_auth} "

Thanks

undefined method path for #<StringIO>

OpenURI open() returns StringIO (with no path method) if file size is < 10Kb

capistrano-scm-jenkins-0.0.5/lib/capistrano/recipes/deploy/scm/jenkins.rb:43:in block in checkout': undefined methodpath' for #StringIO:0x007fd743cd1e60 (NoMethodError)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.