Class: Vigil::Revision
- Inherits:
-
Object
- Object
- Vigil::Revision
- Defined in:
- lib/vigil/revision.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #_box_path(box) ⇒ Object
- #base_box_name ⇒ Object
- #base_box_path ⇒ Object
- #branch ⇒ Object
- #complete_box_name ⇒ Object
- #complete_box_path ⇒ Object
- #git_url ⇒ Object
-
#initialize(id, project) ⇒ Revision
constructor
A new instance of Revision.
- #no_gems_box_name ⇒ Object
- #no_gems_box_path ⇒ Object
- #previous ⇒ Object
- #project_name ⇒ Object
- #run_pipeline ⇒ Object
- #sha ⇒ Object
- #working_dir ⇒ Object
Constructor Details
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/vigil/revision.rb', line 4 def id @id end |
Instance Method Details
#_box_path(box) ⇒ Object
67 68 69 |
# File 'lib/vigil/revision.rb', line 67 def _box_path(box) File.join(@run_dir_boxes, box) end |
#base_box_name ⇒ Object
43 44 45 |
# File 'lib/vigil/revision.rb', line 43 def base_box_name "#{@project.name}-#@id" end |
#base_box_path ⇒ Object
47 48 49 |
# File 'lib/vigil/revision.rb', line 47 def base_box_path _box_path(base_box_name + '.box') end |
#branch ⇒ Object
35 36 37 |
# File 'lib/vigil/revision.rb', line 35 def branch @project.branch end |
#complete_box_name ⇒ Object
59 60 61 |
# File 'lib/vigil/revision.rb', line 59 def complete_box_name base_box_name + '_complete' end |
#complete_box_path ⇒ Object
63 64 65 |
# File 'lib/vigil/revision.rb', line 63 def complete_box_path _box_path(complete_box_name + '.pkg') end |
#git_url ⇒ Object
27 28 29 |
# File 'lib/vigil/revision.rb', line 27 def git_url @project.git_url end |
#no_gems_box_name ⇒ Object
51 52 53 |
# File 'lib/vigil/revision.rb', line 51 def no_gems_box_name base_box_name + '_no_gems' end |
#no_gems_box_path ⇒ Object
55 56 57 |
# File 'lib/vigil/revision.rb', line 55 def no_gems_box_path _box_path(no_gems_box_name + '.pkg') end |
#previous ⇒ Object
19 20 21 |
# File 'lib/vigil/revision.rb', line 19 def previous Revision.new(@id-1, @project) end |
#project_name ⇒ Object
39 40 41 |
# File 'lib/vigil/revision.rb', line 39 def project_name @project.name end |
#run_pipeline ⇒ Object
13 14 15 16 17 |
# File 'lib/vigil/revision.rb', line 13 def run_pipeline @os.mkdir_p working_dir @os.mkdir_p @run_dir_boxes Pipeline.new(self).run end |
#sha ⇒ Object
31 32 33 |
# File 'lib/vigil/revision.rb', line 31 def sha `bash -c 'GIT_DIR=#{File.join(working_dir, '.git')} git rev-parse HEAD'` #FIXME end |
#working_dir ⇒ Object
23 24 25 |
# File 'lib/vigil/revision.rb', line 23 def working_dir File.join(@project.working_dir, @id.to_s) end |