Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updating chef-jenkins

  • Loading branch information...
commit e58303b6429f275ca6458f7ae7e3ae936441b2d2 1 parent 175150c
Jenkins CI authored
View
3  Gemfile
@@ -6,7 +6,7 @@ source "http://rubygems.org"
# Add dependencies to develop your gem here.
# Include everything needed to run rake, tests, features, etc.
group :development do
- gem "rspec", "~> 2.3.0"
+ gem "rspec", ">= 2.3.0"
gem "bundler", "~> 1.0.0"
gem "jeweler", "~> 1.6.2"
gem "rcov", ">= 0"
@@ -16,4 +16,5 @@ group :development do
gem "mixlib-config", ">= 0"
gem "mixlib-log", ">= 0"
gem "git", ">= 1.2.5"
+ gem "rake", ">= 0"
end
View
17 Gemfile.lock
@@ -54,14 +54,14 @@ GEM
rcov (0.9.10)
rest-client (1.6.7)
mime-types (>= 1.16)
- rspec (2.3.0)
- rspec-core (~> 2.3.0)
- rspec-expectations (~> 2.3.0)
- rspec-mocks (~> 2.3.0)
- rspec-core (2.3.1)
- rspec-expectations (2.3.0)
+ rspec (2.8.0)
+ rspec-core (~> 2.8.0)
+ rspec-expectations (~> 2.8.0)
+ rspec-mocks (~> 2.8.0)
+ rspec-core (2.8.0)
+ rspec-expectations (2.8.0)
diff-lcs (~> 1.1.2)
- rspec-mocks (2.3.0)
+ rspec-mocks (2.8.0)
systemu (2.3.0)
treetop (1.4.10)
polyglot
@@ -81,5 +81,6 @@ DEPENDENCIES
mixlib-cli
mixlib-config
mixlib-log
+ rake
rcov
- rspec (~> 2.3.0)
+ rspec (>= 2.3.0)
View
2  lib/chef/application/jenkins.rb
@@ -79,7 +79,7 @@ def run_application
if ARGV[0] == "sync"
jenkins.sync
elsif ARGV[0] == "prop"
- jenkins.prop
+ jenkins.prop(config[:env_from], config[:env_to])
else
Chef::Application.fatal!("You must provide sync or prop as the first argument")
end
View
7 lib/chef/jenkins.rb
@@ -144,6 +144,13 @@ def upload_cookbooks(cookbooks=[])
cu.config[:freeze] = true
cu.run
end
+
+ def prop(env_from=Chef::Config[:jenkins][:env_from], env_to=Chef::Config[:jenkins][:env_to])
+ from = Chef::Environment.load(env_from)
+ to = Chef::Environment.load(env_to)
+ to.cookbook_versions(from.cookbook_versions)
+ to.save
+ end
def sync(cookbook_path=Chef::Config[:cookbook_path], repo_dir=Chef::Config[:jenkins][:repo_dir])
add_upstream
Please sign in to comment.
Something went wrong with that request. Please try again.