vagrant-application-cookbooks 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +5 -0
- data/TODO.md +1 -1
- data/lib/vagrant-application-cookbooks/action/clone.rb +20 -7
- data/lib/vagrant-application-cookbooks/version.rb +1 -1
- metadata +3 -3
data/CHANGELOG.md
CHANGED
data/TODO.md
CHANGED
@@ -13,5 +13,5 @@
|
|
13
13
|
[ ] add spec tests for the clone action
|
14
14
|
[ ] check if url is a valid url
|
15
15
|
[ ] use i18n
|
16
|
-
[
|
16
|
+
[x] suppress stdout / stderr when shelling out git commands
|
17
17
|
[ ] add support for more provisioners / dependency managers
|
@@ -52,20 +52,31 @@ module VagrantPlugins
|
|
52
52
|
def clean_and_clone_repo
|
53
53
|
FileUtils.rm_rf cloned_repo_path
|
54
54
|
FileUtils.mkdir_p cloned_repo_path
|
55
|
-
unless system("git clone #{git_url} #{cloned_repo_path}")
|
55
|
+
unless system("git clone -q #{git_url} #{cloned_repo_path}")
|
56
56
|
raise "something went wrong while cloning '#{git_url}'"
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
-
def
|
61
|
-
|
62
|
-
|
60
|
+
def checkout_and_update
|
61
|
+
Dir.chdir(cloned_repo_path) do
|
62
|
+
# retrieve all refs
|
63
|
+
system("git fetch -q --all")
|
64
|
+
# checkout ref
|
65
|
+
unless system("git checkout -q #{git_ref}")
|
66
|
+
raise "something went wrong while checking out '#{git_ref}'"
|
67
|
+
end
|
68
|
+
# update ref only if we are on a branch, i.e. not on a detached HEAD
|
69
|
+
unless `git symbolic-ref -q HEAD`.empty?
|
70
|
+
system("git pull -q")
|
71
|
+
end
|
63
72
|
end
|
64
73
|
end
|
65
74
|
|
66
75
|
def install_cookbooks
|
67
|
-
|
68
|
-
|
76
|
+
Dir.chdir(cloned_repo_path) do
|
77
|
+
unless system("berks install --path #{cookbook_install_path}")
|
78
|
+
raise "something went wrong while installing cookbook dependencies"
|
79
|
+
end
|
69
80
|
end
|
70
81
|
end
|
71
82
|
|
@@ -91,7 +102,7 @@ module VagrantPlugins
|
|
91
102
|
end
|
92
103
|
|
93
104
|
log "Ensuring application cookbook is checked out at '#{git_ref}'"
|
94
|
-
|
105
|
+
checkout_and_update
|
95
106
|
|
96
107
|
log "Installing application cookbook dependencies to '#{cookbook_install_path}'"
|
97
108
|
install_cookbooks
|
@@ -100,6 +111,8 @@ module VagrantPlugins
|
|
100
111
|
configure_chef_solo
|
101
112
|
end
|
102
113
|
|
114
|
+
raise "boo"
|
115
|
+
|
103
116
|
# continue if ok
|
104
117
|
@app.call(env)
|
105
118
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrant-application-cookbooks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-10-
|
12
|
+
date: 2013-10-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: berkshelf
|
@@ -129,7 +129,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
129
129
|
version: '0'
|
130
130
|
segments:
|
131
131
|
- 0
|
132
|
-
hash:
|
132
|
+
hash: 702792593
|
133
133
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
134
134
|
none: false
|
135
135
|
requirements:
|