shaddox 0.0.17 → 0.0.18
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/Doxfile +1 -4
- data/lib/shaddox/shadow.rb +44 -4
- data/lib/shaddox/version.rb +1 -1
- 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: c18cbc290f82297b28d769119faa938bd5c1afc8
|
4
|
+
data.tar.gz: f534a156a6935e4d83072f642ac78480da4d31f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7de05a55aba7d0d29823186040d1b28bd6cdb83db93dceea037b6e4cd2373f47ef295636c7308c8f7e379994f293dbdbd2d65a117273b5ace801a95ad8e373e4
|
7
|
+
data.tar.gz: 2829ec1d6923c279296f2a891be95f5bd9a204b65ef6ab2caf489da35d3cceca167467614562a480c6cd87880d6bdc805286fbd2e107438aa46bb94ac76a08c0
|
data/Doxfile
CHANGED
data/lib/shaddox/shadow.rb
CHANGED
@@ -43,7 +43,17 @@ module Shaddox
|
|
43
43
|
system("test -e #{path.exp_path}")
|
44
44
|
end
|
45
45
|
|
46
|
+
def exists_d(path)
|
47
|
+
system("test -d #{path.exp_path}")
|
48
|
+
end
|
49
|
+
|
50
|
+
def exists_f(path)
|
51
|
+
system("test -f #{path.exp_path}")
|
52
|
+
end
|
53
|
+
|
46
54
|
def ln_s(source, dest, opts = {})
|
55
|
+
ensure_parent_dir(source)
|
56
|
+
ensure_parent_dir(dest)
|
47
57
|
info "Linking '#{source}' to '#{dest}'", 1 if @verbose
|
48
58
|
FileUtils::ln_s(source.exp_path, dest.exp_path, opts)
|
49
59
|
end
|
@@ -53,6 +63,11 @@ module Shaddox
|
|
53
63
|
FileUtils::mkdir_p(path.exp_path)
|
54
64
|
end
|
55
65
|
|
66
|
+
def ensure_parent_dir(path)
|
67
|
+
dir, base = File.split(path.exp_path)
|
68
|
+
mkdir(dir)
|
69
|
+
end
|
70
|
+
|
56
71
|
def ensure_git()
|
57
72
|
unless @git_installed
|
58
73
|
install 'git'
|
@@ -60,13 +75,38 @@ module Shaddox
|
|
60
75
|
end
|
61
76
|
end
|
62
77
|
|
63
|
-
def
|
64
|
-
|
78
|
+
def repo_deploy(repo_key, deploy_path, opts ={})
|
79
|
+
keep_releases = opts[:keep_releases] || 5
|
65
80
|
repo = @repos[repo_key]
|
66
|
-
|
81
|
+
|
82
|
+
ensure_git()
|
83
|
+
ensure_parent_dir(deploy_path)
|
84
|
+
deploy_path = deploy_path.exp_path
|
85
|
+
|
86
|
+
cd deploy_path do
|
87
|
+
|
88
|
+
# Get the current release number
|
89
|
+
release = 0
|
90
|
+
cd 'releases' do
|
91
|
+
current_max = Dir.entries('.').select { |e| e =~ /\d+/ }.max
|
92
|
+
release = current_max.to_i + 1 if current_max
|
93
|
+
end
|
94
|
+
|
95
|
+
# Make a new release dir
|
96
|
+
release_path = "./releases/#{release}"
|
97
|
+
mkdir(release_path)
|
98
|
+
|
67
99
|
case repo.vcs
|
68
100
|
when :git
|
69
|
-
|
101
|
+
# Clone/update repo in vcs:
|
102
|
+
if exists_d('vcs')
|
103
|
+
cd 'vcs' do
|
104
|
+
sh "git fetch #{repo.url} #{repo.branch}:#{repo.branch} --force"
|
105
|
+
end
|
106
|
+
else
|
107
|
+
sh "git clone #{repo.url} vcs -b #{repo.branch} --bare"
|
108
|
+
end
|
109
|
+
sh "git clone ./vcs #{release_path} --recursive --brach #{repo.branch}"
|
70
110
|
end
|
71
111
|
end
|
72
112
|
end
|
data/lib/shaddox/version.rb
CHANGED