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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 398b75123e0cb97898362fac3068fc5a37400e8b
4
- data.tar.gz: e1cb01ef1ed109c4ad532291f1da1f1e95325452
3
+ metadata.gz: ce152cdc44b931a418fdd26d1f16ee1ce2b8548e
4
+ data.tar.gz: 73e69cfcde105dd54e9b459ef071794a2e2ad97c
5
5
  SHA512:
6
- metadata.gz: eac1048f2ab0ac42171c61e9b8184c19015482d4bda0735dcd32003cfb1d9201987301a2d05224128b1ca571d7265db0a6d226697efc2cfca5aa7154f2cc1855
7
- data.tar.gz: 03fcd3ecfc1244bd2b38f9e3f0740593a97c736a9176ed7ee563d702c54edf4fa270592cd5425456e75b13429794a1c16ec296d2ec03dafb9e4e281894a34aa6
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
- "cd #{config[:path]}"
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 so allow attribute reuse
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)
@@ -1,5 +1,6 @@
1
1
  # Settings
2
2
  user 'remote_user'
3
+ app_name 'app_name'
3
4
  hosts 'stage.example.com'
4
5
  path "/fullpath/to/folder"
5
6
  git_repo 'git@gitaddress:repository.git'
@@ -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
- prerequisite.push config[:setup].map { |task| send task }
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, 'ls -al', 'which ruby']
69
+ [cd_to_path]
66
70
  end
67
71
 
68
72
  def hosts
@@ -2,7 +2,7 @@ module Alphonse
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 1
5
+ TINY = 3
6
6
  PRE = nil
7
7
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
8
8
  end
@@ -1,4 +1,5 @@
1
1
  user 'remote_user'
2
+ app_name 'app_name'
2
3
  hosts 'stage.example.com'
3
4
  path "/fullpath/to/folder"
4
5
  git_repo 'git@gitaddress:repository.git'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: alphonse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Jones