jarl 0.4.0 → 0.5.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e076c0b533e66716c968624611648d1a04994765
4
- data.tar.gz: efadec1a212ef32fc557c67573a5b3e36f43ee9d
3
+ metadata.gz: 2b885c31df83e4e1d596fd35a7c0e2226037720c
4
+ data.tar.gz: 58d6d75c3e4de1c7388cf71efcbacf5a39eacbb4
5
5
  SHA512:
6
- metadata.gz: d69a18c739d116b3cb92948a331d399363eb963d2ef2d0e75dd76681d186d5f8c8c9907b0036217c7277e09aaf19b898551405def83dbbe9d88b0b8071121925
7
- data.tar.gz: 7ce1a86f9a063d968320b9586db3671b7b26835e02265169a3072c3f1afae3e1782e38967e6fda0be99df7fc30b474f4dd08a220d5968b071fccb3e464a77ad9
6
+ metadata.gz: 09300a56b2a21148d43f9aa67f1f63581537c2f04ca4515ab3410c61dad06a2e0f9eff9e9bb10d9837d61ec7b55bd81d38e4f64d3c1d0423755a32987f13fb6d
7
+ data.tar.gz: 4661d30f738b71f06ae2a0dd3b0c353a7bcbb5d32025d0e8a259f5865afc4a5a8adf834bb48fafd04d31b7459dc33942514af6c0ec49656136b72cc9a2e79205
@@ -1,6 +1,6 @@
1
1
  module Jarl
2
2
  class Application
3
- attr_reader :group, :name, :hostname
3
+ attr_reader :group, :name, :hostname, :base_path
4
4
  attr_reader :image, :volumes, :ports, :environment, :entrypoint, :command
5
5
  attr_reader :serial
6
6
 
@@ -14,9 +14,10 @@ module Jarl
14
14
  # - 1234:5678
15
15
  # command: blabla
16
16
  #
17
- def initialize(group, name, params)
17
+ def initialize(group, name, params, base_path)
18
18
  @group = group
19
19
  @name = name
20
+ @base_path = base_path
20
21
  @image = params['image'] || fail("Application '#{self}' has no 'image' defined")
21
22
  unless @image.is_a?(String)
22
23
  fail "Application '#{self}' has invalid 'image' definition, String is expected"
@@ -92,8 +93,7 @@ module Jarl
92
93
  end
93
94
 
94
95
  def build
95
- fail 'Not a file based image' unless image_is_a_path?
96
- Docker::Image.new(image_name, image_path).build!
96
+ Docker::Image.new(image_name, image_full_path).build!
97
97
  end
98
98
 
99
99
  def image_name
@@ -104,6 +104,10 @@ module Jarl
104
104
  image_is_a_path? ? image : nil
105
105
  end
106
106
 
107
+ def image_full_path
108
+ image_is_a_path? ? Pathname.new(base_path).join(image).expand_path : nil
109
+ end
110
+
107
111
  def to_s
108
112
  full_name
109
113
  end
@@ -18,7 +18,7 @@ module Jarl
18
18
 
19
19
  def load_applications
20
20
  YAML.load(File.read(path)).map do |app_name, params|
21
- Application.new(name, app_name, params)
21
+ Application.new(name, app_name, params, path.dirname)
22
22
  end
23
23
  end
24
24
 
data/lib/jarl/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Jarl
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jarl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Kukushkin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-12 00:00:00.000000000 Z
11
+ date: 2015-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor