Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

role & data_bag will detect .json and .rb

  • Loading branch information...
commit efc85dda085c424afa185dbe2fd8648cca7d62c0 1 parent 225df5d
Ruoran Wang authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/chef/jenkins.rb
View
8 lib/chef/jenkins.rb
@@ -113,7 +113,7 @@ def find_all_roles(role_path=Chef::Config[:role_path])
role_path.each do |path|
Dir[File.join(File.expand_path(path), '*')].each do |role|
if File.file?(role)
- if role =~ /(#{File.expand_path(path)}\/.+\.rb)/
+ if role =~ /(#{File.expand_path(path)}\/.+\.(json|rb))/
changed_roles << $1
end
end
@@ -129,7 +129,7 @@ def find_changed_roles(sha1, sha2, role_path=Chef::Config[:role_path], repo_path
@git.diff(sha1, sha2).each do |diff_file|
role_path.each do |path|
full_path_to_file = File.expand_path(File.join(repo_path, diff_file.path))
- if full_path_to_file =~ /(^#{File.expand_path(path)}\/.+\.rb)/
+ if full_path_to_file =~ /(^#{File.expand_path(path)}\/.+\.(json|rb))/
changed_roles << $1
end
end
@@ -145,7 +145,7 @@ def find_all_data_bags(data_bag_path=Chef::Config[:data_bag_path])
if File.directory?(path)
Dir[File.join(File.expand_path(path), '*')].each do |data|
if File.file?(data)
- if data =~ /(#{File.expand_path(path)}\/.+\.json)/
+ if data =~ /(#{File.expand_path(path)}\/.+\.(json|rb))/
changed_data_bags << $1
end
end
@@ -162,7 +162,7 @@ def find_changed_data_bags(sha1, sha2, data_bag_path=Chef::Config[:data_bag_path
@git.diff(sha1, sha2).each do |diff_file|
data_bag_path.each do |path|
full_path_to_file = File.expand_path(File.join(repo_path, diff_file.path))
- if full_path_to_file =~ /(^#{File.expand_path(path)}\/.+\.json)/
+ if full_path_to_file =~ /(^#{File.expand_path(path)}\/.+\.(json|))/
changed_data_bags << $1
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.