chef-solo-wrapper 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/cs +1 -1
- data/lib/cookbooks_fetcher.rb +6 -5
- metadata +3 -3
data/bin/cs
CHANGED
@@ -16,7 +16,7 @@
|
|
16
16
|
# See the License for the specific language governing permissions and
|
17
17
|
# limitations under the License.
|
18
18
|
|
19
|
-
CHEF_SOLO_WRAPPER_VERSION = '0.0.
|
19
|
+
CHEF_SOLO_WRAPPER_VERSION = '0.0.13'
|
20
20
|
COOKBOOKS_SRC_DEST = '/usr/src/chef-cookbooks'
|
21
21
|
|
22
22
|
require 'rubygems'
|
data/lib/cookbooks_fetcher.rb
CHANGED
@@ -7,21 +7,22 @@ class CookbooksFetcher < EasyLogger
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def fetch(cookbooks_src, cookbooks_dest='/usr/src/chef-cookbooks', archive=true)
|
10
|
-
|
10
|
+
logger = EasyLogger.new(@facility_log_level)
|
11
11
|
if Process.uid != 0
|
12
12
|
cookbooks_dest = "#{File.expand_path("~")}/chef-cookbooks"
|
13
13
|
end
|
14
14
|
system("mkdir -p #{cookbooks_dest}")
|
15
|
-
|
15
|
+
logger.log "Cookbooks destination: #{cookbooks_dest}.", [ 'verbose', 'debug' ]
|
16
16
|
repos_name = File.basename(cookbooks_src).gsub('.git', '')
|
17
|
+
logger.log "Inspecting repos, '#{repos_name}'..."
|
17
18
|
if File.exists?("#{cookbooks_dest}/#{repos_name}/.git")
|
18
|
-
|
19
|
+
logger.log "Pulling '#{repos_name}' (instead of cloning)..", 'verbose'
|
19
20
|
pull_cmd = "cd #{cookbooks_dest}/#{repos_name} && git pull 2>&1"
|
20
21
|
pull = "[git] " + `#{pull_cmd}`; result=$?.success?
|
21
22
|
if result
|
22
|
-
|
23
|
+
logger.log pull
|
23
24
|
else
|
24
|
-
|
25
|
+
logger.log pull, 'error'
|
25
26
|
raise "Failed to pull git repository!"
|
26
27
|
end
|
27
28
|
elsif archive
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chef-solo-wrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 13
|
10
|
+
version: 0.0.13
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Chris Fordham
|