dockly 3.1.1 → 3.2.0.pre.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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODQyMjgwNGJkYWE2YThjOTI1OTAxZWRlZmY5ZmIyNThhOThjNWFkMQ==
4
+ N2MzMTNlNjU1OGM5MDJmY2M5MDYxNzk2YjA0OGIyMTVhZmNlNTBkYQ==
5
5
  data.tar.gz: !binary |-
6
- MjgxMDZlMTFmN2QxODZlYTJmZjRlZTJlMzlmNmJmNDA2ODZmNmRmNw==
6
+ MzRhMzcwZTNjYTRmYjFjODk3NTNjNWZjZDJiMGE3YmE2OGE4NjU2Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NDk1ZjAzYmU3MGI3Njk0NDM5MDBkNWNhM2UyMWFiOGZmNDI5OGQ4MDA2Y2Zm
10
- MjE2MzYzOThkYzg1MzZkNTZjZTM0MjEwY2I1ZGMwZTM1OTY4MTQ5ZTk0MTZi
11
- ZGQyYzM4ODg2YjgyMmE4ZDYxMDIwZDY3ZDM3MGQyYmFkNDIyMTE=
9
+ NzNmMjE0ZWE2NmI1OTcxOTNhZTY1MzU0NzhlNGRmYTQwMzc2NWNhOGYwZWRm
10
+ ZDljZGI3ODZiYjdkZjI3MzM2NzAwODM1ZDEwYjU1MjIzOGQ5YzQ2OWRlMjg0
11
+ MWNjNjBlMGI0M2NkYTBjNmI4ZmI1ZjZlYTcxZjBlY2I0MmViMDU=
12
12
  data.tar.gz: !binary |-
13
- MmM2YTFhODIzZWE3MTFlOWY4YTgyMGNlNzZkMWJiZmYxNDIzOTkxMTk1ZjMw
14
- MTQxOTE2ODA2NjM4OGFiNjhlNGQyOTk2YWM1OTQ0ZDRhNzZkYjNhNmRhNDIz
15
- NTg2ZjI1NTc5MWM3MzU3ZWFkNGJjZWUwZTVkYTA2MjQzMTg4ZTA=
13
+ NDQwYWNkOWViYWFmZDg3NzljNGMyM2VmNjc0NGZhOTUyMDQ0Yjc4MTlmMDRj
14
+ NDQzNzVjMjEyMjBjODllMmJkOWY4ZDE4NGQ1NjIxZWMyZjQzZTUzZjg3NDU1
15
+ NWVhMTRlYjg1NWVjMmQ1MDMzNDNhOTA2NDQ5MjNiZGQzYTlmNGQ=
@@ -10,8 +10,9 @@ require 'open3'
10
10
  module Dockly
11
11
  LOAD_FILE = 'dockly.rb'
12
12
 
13
- attr_reader :instance, :git_sha
14
- attr_writer :load_file
13
+ class << self
14
+ attr_writer :load_file
15
+ end
15
16
 
16
17
  autoload :Foreman, 'dockly/foreman'
17
18
  autoload :BashBuilder, 'dockly/bash_builder'
@@ -30,7 +31,7 @@ module Dockly
30
31
  @load_file || LOAD_FILE
31
32
  end
32
33
 
33
- def inst
34
+ def instance
34
35
  @instance ||= load_inst
35
36
  end
36
37
 
@@ -82,7 +83,7 @@ module Dockly
82
83
 
83
84
  [:debs, :rpms, :dockers, :foremans].each do |method|
84
85
  define_method(method) do
85
- inst[method]
86
+ instance[method]
86
87
  end
87
88
 
88
89
  module_function method
@@ -96,7 +97,7 @@ module Dockly
96
97
  }.each do |method, klass|
97
98
  define_method(method) do |sym, &block|
98
99
  if block.nil?
99
- inst[:"#{method}s"][sym]
100
+ instance[:"#{method}s"][sym]
100
101
  else
101
102
  klass.new!(:name => sym, &block)
102
103
  end
@@ -14,17 +14,40 @@ class Dockly::AbstractCommand < Clamp::Command
14
14
  end
15
15
  end
16
16
 
17
- class Dockly::BuildCommand < Dockly::AbstractCommand
17
+ class Dockly::BuildOrCopyAllCommand < Dockly::AbstractCommand
18
+ def execute
19
+ super
20
+ Rake::Task["dockly:build_or_copy_all"].invoke
21
+ end
22
+ end
23
+
24
+ class Dockly::BuildDebCommand < Dockly::AbstractCommand
25
+ parameter 'PACKAGE', 'the name to build the package for', :attribute_name => :package_name
26
+ option ['-n', '--no-export'], :flag, 'do not export', :default => false, :attribute_name => :noexport
27
+
28
+ def execute
29
+ super
30
+ if Dockly.debs[package_name.to_sym]
31
+ if noexport?
32
+ Rake::Task["dockly:deb:prepare"].invoke(package_name)
33
+ else
34
+ Rake::Task["dockly:deb:build"].invoke(package_name)
35
+ end
36
+ end
37
+ end
38
+ end
39
+
40
+ class Dockly::BuildRpmCommand < Dockly::AbstractCommand
18
41
  parameter 'PACKAGE', 'the name to build the package for', :attribute_name => :package_name
19
- option ['-f', '--force'], :flag, 'force the package build', :default => false, :attribute_name => :force
42
+ option ['-n', '--no-export'], :flag, 'do not export', :default => false, :attribute_name => :noexport
20
43
 
21
44
  def execute
22
45
  super
23
- if package = Dockly.debs[package_name.to_sym]
24
- if force? || !package.exists?
25
- package.build
46
+ if Dockly.rpms[package_name.to_sym]
47
+ if noexport?
48
+ Rake::Task["dockly:rpm:prepare"].invoke(package_name)
26
49
  else
27
- puts "Package already exists!"
50
+ Rake::Task["dockly:rpm:build"].invoke(package_name)
28
51
  end
29
52
  end
30
53
  end
@@ -32,20 +55,15 @@ end
32
55
 
33
56
  class Dockly::DockerCommand < Dockly::AbstractCommand
34
57
  parameter 'DOCKER', 'the name to generate the docker image for', :attribute_name => :docker_name
35
- option ['-f', '--force'], :flag, 'force the package build', :default => false, :attribute_name => :force
36
58
  option ['-n', '--no-export'], :flag, 'do not export', :default => false, :attribute_name => :noexport
37
59
 
38
60
  def execute
39
61
  super
40
- if docker = Dockly.dockers[docker_name.to_sym]
41
- if force? || !docker.exists?
42
- if noexport?
43
- docker.generate_build
44
- else
45
- docker.generate!
46
- end
62
+ if Dockly.dockers[docker_name.to_sym]
63
+ if noexport?
64
+ Rake::Task["dockly:docker:prepare"].invoke(docker_name)
47
65
  else
48
- puts "Package already exists!"
66
+ Rake::Task["dockly:docker:build"].invoke(docker_name)
49
67
  end
50
68
  end
51
69
  end
@@ -56,6 +74,7 @@ class Dockly::ListCommand < Dockly::AbstractCommand
56
74
  super
57
75
  dockers = Dockly.dockers.dup
58
76
  debs = Dockly.debs
77
+ rpms = Dockly.rpms
59
78
 
60
79
  puts "Debs" unless debs.empty?
61
80
  debs.each_with_index do |(name, package), index|
@@ -66,6 +85,15 @@ class Dockly::ListCommand < Dockly::AbstractCommand
66
85
  end
67
86
  end
68
87
 
88
+ puts "RPMs" unless rpms.empty?
89
+ rpms.each_with_index do |(name, package), index|
90
+ puts "#{index + 1}. #{name}"
91
+ if package.docker
92
+ dockers.delete(package.docker.name)
93
+ puts " - Docker: #{package.docker.name}"
94
+ end
95
+ end
96
+
69
97
  puts "Dockers" unless dockers.empty?
70
98
  dockers.each_with_index do |(name, docker), index|
71
99
  puts "#{index + 1}. #{name}"
@@ -104,7 +132,10 @@ class Dockly::BuildCacheCommand < Dockly::AbstractCommand
104
132
  end
105
133
 
106
134
  class Dockly::Cli < Dockly::AbstractCommand
107
- subcommand ['build', 'b'], 'Create package', Dockly::BuildCommand
135
+ subcommand ['build-or-copy-all'], 'Run build or copy all Rake task', Dockly::BuildOrCopyAllCommand
136
+ subcommand ['build', 'b'], 'Create deb package', Dockly::BuildDebCommand
137
+ subcommand ['build-deb', 'bd'], 'Create deb package', Dockly::BuildDebCommand
138
+ subcommand ['build-rpm', 'br'], 'Create RPM package', Dockly::BuildRpmCommand
108
139
  subcommand ['docker', 'd'], 'Generate docker image', Dockly::DockerCommand
109
140
  subcommand ['list', 'l'], 'List packages', Dockly::ListCommand
110
141
  subcommand ['build_cache', 'bc'], 'Build Cache commands', Dockly::BuildCacheCommand
@@ -34,7 +34,7 @@ namespace :dockly do
34
34
 
35
35
  task :load do
36
36
  raise "No #{Dockly.load_file} found!" unless File.exist?(Dockly.load_file)
37
- Dockly.inst
37
+ Dockly.instance
38
38
  end
39
39
 
40
40
  task :assume_role => 'dockly:load' do
@@ -1,8 +1,8 @@
1
1
  module Dockly
2
2
  MAJOR = 3
3
- MINOR = 1
4
- PATCH = 1
5
- RELEASE = nil
3
+ MINOR = 2
4
+ PATCH = 0
5
+ RELEASE = 'pre.1'
6
6
 
7
7
  VERSION = [MAJOR, MINOR, PATCH, RELEASE].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockly
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.2.0.pre.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swipely, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-26 00:00:00.000000000 Z
11
+ date: 2016-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: clamp
@@ -305,9 +305,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
305
305
  version: '0'
306
306
  required_rubygems_version: !ruby/object:Gem::Requirement
307
307
  requirements:
308
- - - ! '>='
308
+ - - ! '>'
309
309
  - !ruby/object:Gem::Version
310
- version: '0'
310
+ version: 1.3.1
311
311
  requirements: []
312
312
  rubyforge_project:
313
313
  rubygems_version: 2.6.2