Class: Vigil::Pipeline
- Inherits:
-
Object
- Object
- Vigil::Pipeline
- Defined in:
- lib/vigil/pipeline.rb
Instance Method Summary collapse
- #_git_clone ⇒ Object
- #_run_tests ⇒ Object
- #_start_vm ⇒ Object
-
#initialize(revision, args = {}) ⇒ Pipeline
constructor
A new instance of Pipeline.
- #run ⇒ Object
Constructor Details
Instance Method Details
#_git_clone ⇒ Object
20 21 22 23 24 |
# File 'lib/vigil/pipeline.rb', line 20 def _git_clone return if @os.exists? File.join(@revision.working_dir, '.git') Git.clone @revision.git_url, '.' Git.checkout @revision.branch end |
#_run_tests ⇒ Object
32 33 34 |
# File 'lib/vigil/pipeline.rb', line 32 def _run_tests Vagrant.run "ssh -c 'cd /vagrant; rake test'" end |
#_start_vm ⇒ Object
26 27 28 29 30 |
# File 'lib/vigil/pipeline.rb', line 26 def _start_vm Vagrant.run "box add --force '#{@revision.complete_box_name}' '#{@revision.complete_box_path}'" Vagrant.use @revision.complete_box_name Vagrant.run "up" end |
#run ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/vigil/pipeline.rb', line 11 def run @os.chdir @revision.working_dir _git_clone @vmbuilder.run _start_vm _run_tests @plugman.notify(:task_done, 'tests') end |