alphonse 0.0.1 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/alphonse/configs/operation.rb +5 -1
- data/lib/alphonse/configs/setting.rb +6 -2
- data/lib/alphonse/default/fonzfile.rb +1 -0
- data/lib/alphonse/operator.rb +6 -2
- data/lib/alphonse/version.rb +1 -1
- data/spec/fonzfiles/default +1 -0
- 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: ce152cdc44b931a418fdd26d1f16ee1ce2b8548e
|
4
|
+
data.tar.gz: 73e69cfcde105dd54e9b459ef071794a2e2ad97c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34504250ecb736afae151f7390b936afe5e146e492ff592aa72eba8037e96881df45b559f1349a724b7279e96e9fd3c178aa237da36ee50a476d133c8c422713
|
7
|
+
data.tar.gz: 3ca97f2daed5f477bfbd9aef8dbb9e8809cd3d8805bb8401e8f0ff81eac01cca8a897cd32afa199514db086d70894f5b06b72941b93f8d871d2ae6caea036e34
|
@@ -53,10 +53,14 @@ module Alphonse
|
|
53
53
|
alias :setup_directory :mkdir_path
|
54
54
|
|
55
55
|
def cd_to_path
|
56
|
-
"
|
56
|
+
"#{cd_to_parent_path}#{config[:app_name]}"
|
57
57
|
end
|
58
58
|
alias :cd :cd_to_path
|
59
59
|
|
60
|
+
def cd_to_parent_path
|
61
|
+
"cd #{config[:path]}"
|
62
|
+
end
|
63
|
+
|
60
64
|
def git_pull
|
61
65
|
["git checkout #{branch} -q", "git pull origin #{branch} -q", "git gc --aggressive"]
|
62
66
|
end
|
@@ -2,7 +2,7 @@ module Alphonse
|
|
2
2
|
module Configs
|
3
3
|
module Setting
|
4
4
|
|
5
|
-
# TODO: evaluate attributes
|
5
|
+
# TODO: evaluate attributes to allow attribute reuse
|
6
6
|
# E.g.
|
7
7
|
# user = "user_name"
|
8
8
|
# path = "/full/path/to/#{user}" => "/full/path/to/user_name"
|
@@ -11,12 +11,16 @@ module Alphonse
|
|
11
11
|
set_attr :user => value
|
12
12
|
end
|
13
13
|
|
14
|
+
def app_name(value)
|
15
|
+
set_attr :app_name => value
|
16
|
+
end
|
17
|
+
|
14
18
|
def hosts(*value)
|
15
19
|
set_attr :hosts => [*value].flatten
|
16
20
|
end
|
17
21
|
|
18
22
|
def path(value)
|
19
|
-
set_attr :path => value
|
23
|
+
set_attr :path => (value[-1] == '/' ? value : "#{value}/")
|
20
24
|
end
|
21
25
|
|
22
26
|
def git_repo(value)
|
data/lib/alphonse/operator.rb
CHANGED
@@ -34,7 +34,7 @@ module Alphonse
|
|
34
34
|
# Create and setup folder on remote server
|
35
35
|
def setup
|
36
36
|
Alphonse.logger.operation config[:setup_description]
|
37
|
-
|
37
|
+
setup_prerequisite.push config[:setup].map { |task| send task }
|
38
38
|
end
|
39
39
|
|
40
40
|
# First time deploy of app to remote server
|
@@ -61,8 +61,12 @@ module Alphonse
|
|
61
61
|
prerequisite.push config[:restart].map { |task| send(task) }
|
62
62
|
end
|
63
63
|
|
64
|
+
def setup_prerequisite
|
65
|
+
[cd_to_parent_path]
|
66
|
+
end
|
67
|
+
|
64
68
|
def prerequisite
|
65
|
-
[cd_to_path
|
69
|
+
[cd_to_path]
|
66
70
|
end
|
67
71
|
|
68
72
|
def hosts
|
data/lib/alphonse/version.rb
CHANGED
data/spec/fonzfiles/default
CHANGED