unfold 1.0 → 1.0.1
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.
- checksums.yaml +4 -4
- data/lib/unfold.rb +5 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cac5b5e9580da7fa1d53e368a9973630601016eb
|
4
|
+
data.tar.gz: e880c9effeff80330533fb1d5d0d2a6d4d8f43af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e873293ca34d69abb1490c8297ac7f5a9a43c29362c47dea0a24d574c757989903313e7fc7b5400b5ae670bc402719e2688da66c67a97f83b9e895e05ec188d5
|
7
|
+
data.tar.gz: 8343056f19ac5ac04f5e7b355dd44edbfebe384c4f6315e5d625109dd27a740bdb67fd0efa2cddcdf922be236807e3b80842fe0fe76740ea5f2b12c86da6e69e
|
data/lib/unfold.rb
CHANGED
@@ -32,7 +32,7 @@ module Unfold
|
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
35
|
-
# creates a post-receive hook script from a
|
35
|
+
# creates a post-receive hook script from a configuration
|
36
36
|
def self.post_receive_script(c)
|
37
37
|
log_location = "~/.unfold/logs/#{c.appname}-#{c.env}/deploy.log"
|
38
38
|
postdep = "#{c.remote_destination}/config/unfold_postdeploy.rb"
|
@@ -60,7 +60,6 @@ module Unfold
|
|
60
60
|
|
61
61
|
# set up the local git repo's remotes
|
62
62
|
configs.each do |c|
|
63
|
-
# add it as a remote to the local git repo
|
64
63
|
repo_path = "~/.unfold/repos/#{c.appname}-#{c.env}.git"
|
65
64
|
`git remote add #{c.env} #{c.remote_user}@#{c.remote_host}:#{repo_path}`
|
66
65
|
end
|
@@ -81,8 +80,8 @@ module Unfold
|
|
81
80
|
logs_path = "#{path}/.unfold/logs/#{c.appname}-#{c.env}/"
|
82
81
|
|
83
82
|
# create the remote repo
|
84
|
-
|
85
|
-
|
83
|
+
ssh.exec!("mkdir -p #{repo_path}; mkdir -p #{logs_path}")
|
84
|
+
ssh.exec!("cd #{repo_path}; git --bare init")
|
86
85
|
|
87
86
|
# upload the post-receive hook
|
88
87
|
script = StringIO.new(Unfold.post_receive_script(c))
|
@@ -90,10 +89,10 @@ module Unfold
|
|
90
89
|
ssh.scp.upload!(script, dest)
|
91
90
|
|
92
91
|
# make it executable
|
93
|
-
|
92
|
+
ssh.exec!("chmod 775 #{repo_path}/hooks/post-receive")
|
94
93
|
|
95
94
|
# move to the deployment target and locally clone the repo
|
96
|
-
|
95
|
+
ssh.exec!("cd #{c.remote_destination}; git clone #{repo_path} .")
|
97
96
|
end
|
98
97
|
end
|
99
98
|
end
|