hdeploy 0.1.0 → 0.1.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/.gitignore +1 -0
- data/bin/hdeploy_client +12 -1
- data/hdeploy.gemspec +1 -1
- data/lib/hdeploy/client.rb +2 -3
- data/lib/hdeploy/conf.rb +15 -1
- data/lib/hdeploy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8dbe68129b28119d741132d4054ceaa2a644b97
|
4
|
+
data.tar.gz: f3254d8bf8dbcef3fffa80fe29123cd1e886567b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16992c965bd5091faf81d3428b8c88c9db56e1431190463cfd2eca0e9beed0879b055ca4c7945ed6713fb6d1d6276d7500c9b3b7926c313323a221db09050ebe
|
7
|
+
data.tar.gz: a9126bb825a15a6b47fb79d026687f96ed28a168f56a35dfaa8d680d41cd362486a2d7f7cbba0da33fef2b378e0445ee154816bdd01bec12ae37ec4e02d2be10
|
data/.gitignore
CHANGED
data/bin/hdeploy_client
CHANGED
@@ -11,7 +11,7 @@ node = HDeploy::Client.new
|
|
11
11
|
# Fixme: slightly better error msgs etc
|
12
12
|
|
13
13
|
if ARGV.length == 0
|
14
|
-
raise "please specify a command such symlink post_distribute_run_once post_symlink_run_once"
|
14
|
+
raise "please specify a command such symlink post_distribute_run_once post_symlink_run_once keepalive"
|
15
15
|
else
|
16
16
|
if ARGV.first == 'symlink'
|
17
17
|
# we need special syntax: symlink app env
|
@@ -33,6 +33,17 @@ else
|
|
33
33
|
end
|
34
34
|
|
35
35
|
client.run_hook(ARGV[0],params)
|
36
|
+
elsif ARGV.first == 'keepalive'
|
37
|
+
|
38
|
+
if ARGV.count == 2
|
39
|
+
if ARGV.last.to_i > 10 and ARGV.last.to_i < 300 # just reasonnable values
|
40
|
+
(HDeploy::Conf.instance)['client']['keepalive_delay'] = ARGV.last.to_i
|
41
|
+
else
|
42
|
+
raise "if you specify a keepalive, it must be a number of seconds between 10 and 300 - default is #{(HDeploy::Conf.instance)['client']['keepalive_delay']}"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
client.send('keepalive')
|
46
|
+
|
36
47
|
else
|
37
48
|
client.send(ARGV.first)
|
38
49
|
end
|
data/hdeploy.gemspec
CHANGED
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.summary = %q{no summary}
|
11
11
|
s.homepage = "https://github.com/hdeploy/hdeploy"
|
12
12
|
|
13
|
-
s.files = `git ls-files`.split($/).select{|i| not i.start_with? 'omnibus/'}
|
13
|
+
s.files = `git ls-files`.split($/).select{|i| not i.start_with? 'omnibus/' and not i.downcase.start_with? 'vagrant' }
|
14
14
|
s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
15
15
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
16
16
|
s.require_paths = ["lib"]
|
data/lib/hdeploy/client.rb
CHANGED
@@ -3,13 +3,12 @@ require 'json'
|
|
3
3
|
require 'fileutils'
|
4
4
|
require 'pathname'
|
5
5
|
require 'inifile'
|
6
|
-
require 'pry'
|
7
6
|
|
8
7
|
module HDeploy
|
9
8
|
class Client
|
10
9
|
|
11
10
|
def initialize
|
12
|
-
@conf = HDeploy::Conf.instance
|
11
|
+
@conf = HDeploy::Conf.instance #FIXME search for the configuration at the right place
|
13
12
|
@conf.add_defaults({
|
14
13
|
'client' => {
|
15
14
|
'keepalive_delay' => 60,
|
@@ -171,7 +170,7 @@ module HDeploy
|
|
171
170
|
# FIXME: add altsource and BREAK
|
172
171
|
# FIXME: don't run download as root!!
|
173
172
|
#####
|
174
|
-
if f = find_executable('
|
173
|
+
if f = find_executable('aria2c')
|
175
174
|
system("#{f} -x 5 -d #{tgzpath} -o #{artifact}.tar.gz #{artdata['source']}")
|
176
175
|
|
177
176
|
elsif f = find_executable('wget')
|
data/lib/hdeploy/conf.rb
CHANGED
@@ -11,12 +11,26 @@ module HDeploy
|
|
11
11
|
attr_reader :file
|
12
12
|
|
13
13
|
def initialize(file)
|
14
|
+
|
15
|
+
# this is for omnibus and such
|
16
|
+
# not very elegant but it works...
|
17
|
+
if file.nil?
|
18
|
+
f = __FILE__
|
19
|
+
if f.start_with? '/opt/hdeploy/'
|
20
|
+
file = '/opt/hdeploy/hdeploy.json'
|
21
|
+
elsif f.start_with? '/opt/hdeploy-server/'
|
22
|
+
file = '/opt/hdeploy-server/hdeploy-server.json'
|
23
|
+
else
|
24
|
+
file = './hdeploy.json'
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
14
28
|
@file = file
|
15
29
|
reload
|
16
30
|
end
|
17
31
|
|
18
32
|
# FIXME: find a good way to set default path
|
19
|
-
def self.instance(path =
|
33
|
+
def self.instance(path = nil)
|
20
34
|
@@instance ||= new(path)
|
21
35
|
end
|
22
36
|
|
data/lib/hdeploy/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hdeploy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Viet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: json
|