app_builder 0.2.2 → 0.2.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
- SHA1:
3
- metadata.gz: dad912913e254710c4ca68c24ec5464abbd76e38
4
- data.tar.gz: ed67716a1ccf827d5896094e55e23970d2318dbe
2
+ SHA256:
3
+ metadata.gz: 0e5234bd5e7c932b29ea147367c2ad29a69b832d6b9a26c4f442eae948913dbe
4
+ data.tar.gz: 27ec4ebd788679816462232de6749ceeb14aa4916312ad34d09119ed76f78210
5
5
  SHA512:
6
- metadata.gz: 47bba6a7738eb706f2d955f57106d9f94eb765e8058407e614a7e33551fcf9490acd64284e066b732b4586ced1e32b5e4f079026edd5645d9b846d3bbe76c919
7
- data.tar.gz: 84289b13df0e63e9a5cfb4ec14fdec4d8650dc3dea7339ea24a11e6fabcc0bff1977308e37bdc318583ce2cbc7b901130fbea83766defac95c4bbf7a38fbe78b
6
+ metadata.gz: 43bc7d20d99fc97fb6dc31e1efc6a8fab601f72829e5ed2a3f27672a2d84c014d7519e84874356b247efcfd27c0a1aa5b16294d222d7ac5f43c03c57d25fd4fa
7
+ data.tar.gz: e243fc9e933047dc710c4f1667e8d967045862d8fd973d4cbca647488d02e81535d29776f7ac6b776d34653b74af8462b2fcf9dd104ddf710a964f440c1a96db
@@ -1,10 +1,12 @@
1
1
  module AppBuilder
2
2
  class Environment
3
3
  attr_accessor :name
4
- attr_reader :source_path
4
+ attr_reader :repo_path, :branch, :source_path
5
5
 
6
- def initialize(name, source_path)
7
- @name = name
6
+ def initialize(source_path, name: nil, repo_path: nil, branch: nil)
7
+ @name = name || ENV.fetch("APP_ENV", "default")
8
+ @repo_path = repo_path || `git rev-parse --show-toplevel`.chomp
9
+ @branch = branch || `git symbolic-ref --short HEAD`.chomp
8
10
  @source_path = source_path
9
11
  end
10
12
 
@@ -31,7 +33,13 @@ module AppBuilder
31
33
  alias :hash :to_hash
32
34
 
33
35
  def source
34
- @source ||= YAML.load(ERB.new(File.read(source_path)).result(binding))
36
+ @source ||= YAML.load(
37
+ ERB.new(
38
+ Dir.chdir(repo_path) {
39
+ `git show #{branch}:#{source_path}`
40
+ }
41
+ ).result(binding)
42
+ )
35
43
  end
36
44
  end
37
45
  end
@@ -8,12 +8,14 @@ commands:
8
8
  - mkdir -p <%= remote_app_home %>/shared/log
9
9
  - mkdir -p <%= remote_app_home %>/shared/pids
10
10
  - mkdir -p <%= remote_app_home %>/shared/bindle
11
+ - mkdir -p <%= remote_app_home %>/shared/sockets
11
12
  post:
12
13
  - ln -nfs <%= remote_app_home %>/releases/<%= build_id %> <%= remote_app_home %>/current
13
14
  - rm -rf <%= remote_app_home %>/current/log
14
15
  - ln -nfs <%= remote_app_home %>/shared/log <%= remote_app_home %>/current/log
15
16
  - mkdir -p <%= remote_app_home %>/current/tmp
16
17
  - ln -nfs <%= remote_app_home %>/shared/pids <%= remote_app_home %>/current/tmp/pids
18
+ - ln -nfs <%= remote_app_home %>/shared/sockets <%= remote_app_home %>/current/tmp/sockets
17
19
  - cd <%= remote_app_home %>/current && bundle install --deployment --without development test --path <%= remote_app_home %>/shared/bundle
18
20
  - echo 'deploy done'
19
21
  success:
@@ -1,3 +1,3 @@
1
1
  module AppBuilder
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: app_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - i2bskn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-15 00:00:00.000000000 Z
11
+ date: 2018-07-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  version: '0'
155
155
  requirements: []
156
156
  rubyforge_project:
157
- rubygems_version: 2.6.11
157
+ rubygems_version: 2.7.6
158
158
  signing_key:
159
159
  specification_version: 4
160
160
  summary: Application build utilities.