Sha256: 4ac810aa14eb8caa0bc9e61345a64ebe40f2ce29642973a8898a41cf778798ac

Contents?: true

Size: 1.28 KB

Versions: 6

Compression:

Stored size: 1.28 KB

Contents

namespace :jenkins do

  def strategy
    @strategy ||= Capistrano::Jenkins.new(
      self,
      fetch(:jenkins_strategy, Capistrano::Jenkins::DefaultStrategy))
  end

  desc 'Check that Jenkins is reachable & the last build is green'
  task :check do
    on release_roles :all do
      strategy.check
    end
  end

  desc 'Clone the repo to the cache'
  task clone: :'jenkins:check' do
    on release_roles :all do
      if strategy.test
        info t(:mirror_exists, at: repo_path)
      else
        within deploy_path do
          debug "We're not cloning anything, just creating #{repo_path}"
          strategy.clone
        end
      end
    end
  end

  desc 'Update the repo mirror to reflect the origin state'
  task update: :'jenkins:clone' do
    on release_roles :all do
      within repo_path do
        strategy.update
      end
    end
  end

  desc 'Copy repo to releases'
  task create_release: :'jenkins:update' do
    on release_roles :all do
      within repo_path do
        execute :mkdir, '-p', release_path
        strategy.release
      end
    end
  end

  desc 'Determine the revision that will be deployed'
  task :set_current_revision do
    on release_roles :all do
      within repo_path do
        set :current_revision, strategy.fetch_revision
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
capistrano-scm-jenkins-0.5.1 lib/capistrano/tasks/jenkins.rake
capistrano-scm-jenkins-0.5.0 lib/capistrano/tasks/jenkins.rake
capistrano-scm-jenkins-0.4.0 lib/capistrano/tasks/jenkins.rake
capistrano-scm-jenkins-0.3.3 lib/capistrano/tasks/jenkins.rake
capistrano-scm-jenkins-0.3.2 lib/capistrano/tasks/jenkins.rake
capistrano-scm-jenkins-0.3.1 lib/capistrano/tasks/jenkins.rake