Class: DockerFlow::RakeBuilder
- Inherits:
-
Object
- Object
- DockerFlow::RakeBuilder
- Defined in:
- lib/rake/rake-builder.rb
Instance Method Summary collapse
- #branch_container_name ⇒ Object
- #branch_container_tag ⇒ Object
- #build_container_name ⇒ Object
- #build_container_tag ⇒ Object
- #current_branch ⇒ Object
- #current_version ⇒ Object
-
#initialize(title, repository, tag_prefix = '') ⇒ RakeBuilder
constructor
A new instance of RakeBuilder.
- #is_ci ⇒ Object
- #repository ⇒ Object
- #title ⇒ Object
Constructor Details
#initialize(title, repository, tag_prefix = '') ⇒ RakeBuilder
Returns a new instance of RakeBuilder.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rake/rake-builder.rb', line 7 def initialize(title, repository, tag_prefix='') @title = title @repository = repository @is_ci = DockerFlow::Utils.is_ci @current_branch = DockerFlow::Utils.get_branch @current_version = DockerFlow::Utils.get_commit_version @branch_container_tag = @current_branch @build_container_tag = "#{@current_branch}-#{@current_version}" if tag_prefix.length > 0 @build_container_tag = "#{tag_prefix}-#{@build_container_tag}" @branch_container_tag = "#{tag_prefix}-#{@branch_container_tag}" end @build_container_name = "#{repository}:#{@build_container_tag}" @branch_container_name = "#{repository}:#{@branch_container_tag}" @info = { :host_type => @is_ci? 'Continuous Integration': 'Development', :branch => @current_branch, :commit_version => @current_version, :repository => @repository, :build_container_tag => @build_container_tag, :branch_container_tag => @branch_container_tag } init_print end |
Instance Method Details
#branch_container_name ⇒ Object
61 62 63 |
# File 'lib/rake/rake-builder.rb', line 61 def branch_container_name @branch_container_name end |
#branch_container_tag ⇒ Object
69 70 71 |
# File 'lib/rake/rake-builder.rb', line 69 def branch_container_tag @branch_container_tag end |
#build_container_name ⇒ Object
57 58 59 |
# File 'lib/rake/rake-builder.rb', line 57 def build_container_name @build_container_name end |
#build_container_tag ⇒ Object
65 66 67 |
# File 'lib/rake/rake-builder.rb', line 65 def build_container_tag @build_container_tag end |
#current_branch ⇒ Object
49 50 51 |
# File 'lib/rake/rake-builder.rb', line 49 def current_branch @current_branch end |
#current_version ⇒ Object
53 54 55 |
# File 'lib/rake/rake-builder.rb', line 53 def current_version @current_version end |
#is_ci ⇒ Object
45 46 47 |
# File 'lib/rake/rake-builder.rb', line 45 def is_ci @is_ci end |
#repository ⇒ Object
37 38 39 |
# File 'lib/rake/rake-builder.rb', line 37 def repository @repository end |
#title ⇒ Object
41 42 43 |
# File 'lib/rake/rake-builder.rb', line 41 def title @title end |