Sha256: 0c391dbce072075d4c6b865f393a7a152b16ad50d6f3469019825fc05db96887

Contents?: true

Size: 1.8 KB

Versions: 2

Compression:

Stored size: 1.8 KB

Contents

##
# This task is intended to retrieve packages from the distribution server that
# have been built by jenkins and placed in a specific location,
# /opt/jenkins-builds/$PROJECT/$SHA where $PROJECT is the build project as
# established in project_data.yaml and $SHA is the git sha/tag of the project that
# was built into packages. The current day is assumed, but an environment
# variable override exists to retrieve packages from another day. The sha/tag is
# assumed to be the current project's HEAD, e.g.  to retrieve packages for a
# release of 3.1.0, checkout 3.1.0 locally before retrieving.
#

namespace :pl do
  namespace :jenkins do
    desc "Retrieve packages from the distribution server\. Check out commit to retrieve"
    task :retrieve, :target do |t, args|
      target = args.target || "artifacts"
      invoke_task("pl:fetch")
      mkdir_p 'pkg'
      package_url = "http://#{@build.builds_server}/#{@build.project}/#{@build.ref}/#{target}"
      if wget=find_tool("wget")
        sh "#{wget} -r -np -nH --cut-dirs 3 -P pkg --reject 'index*' #{package_url}/"
      else
        warn "Could not find `wget` tool. Falling back to rsyncing from #{@build.distribution_server}"
        begin
          rsync_from("#{@build.jenkins_repo_path}/#{@build.project}/#{@build.ref}/#{target}/", @build.distribution_server, "pkg/")
        rescue
          fail "Couldn't download packages from distribution server. Try installing wget!"
        end
      end
      puts "Packages staged in pkg"
    end
  end
end

if @build.build_pe
  namespace :pe do
    namespace :jenkins do
      desc "Retrieve packages from the distribution server\. Check out commit to retrieve"
      task :retrieve, :target do |t, args|
        target = args.target || "artifacts"
        invoke_task("pl:jenkins:retrieve", target)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
puppet-2.7.25 ext/packaging/tasks/retrieve.rake
puppet-2.7.24 ext/packaging/tasks/retrieve.rake