Class: GTA::Deploy
Instance Attribute Summary collapse
-
#gta_config_path ⇒ Object
readonly
Returns the value of attribute gta_config_path.
-
#stage_name ⇒ Object
readonly
Returns the value of attribute stage_name.
Instance Method Summary collapse
- #deploy(forced = nil) ⇒ Object
- #destination ⇒ Object
-
#initialize(stage_name, gta_config_path = nil) ⇒ Deploy
constructor
A new instance of Deploy.
- #manager ⇒ Object
- #source ⇒ Object
Methods included from Sh
Constructor Details
#initialize(stage_name, gta_config_path = nil) ⇒ Deploy
Returns a new instance of Deploy.
7 8 9 10 |
# File 'lib/gta/deploy.rb', line 7 def initialize(stage_name, gta_config_path=nil) @stage_name = stage_name @gta_config_path = gta_config_path end |
Instance Attribute Details
#gta_config_path ⇒ Object (readonly)
Returns the value of attribute gta_config_path.
5 6 7 |
# File 'lib/gta/deploy.rb', line 5 def gta_config_path @gta_config_path end |
#stage_name ⇒ Object (readonly)
Returns the value of attribute stage_name.
5 6 7 |
# File 'lib/gta/deploy.rb', line 5 def stage_name @stage_name end |
Instance Method Details
#deploy(forced = nil) ⇒ Object
24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/gta/deploy.rb', line 24 def deploy(forced=nil) destination.fetch! source.fetch! source.checkout! # so the tracking branch exists sh("git checkout master") # in case the latest deploy code is not on that branch forced == :force ? destination.force_push : destination.push sh('git checkout master') end |
#destination ⇒ Object
16 17 18 |
# File 'lib/gta/deploy.rb', line 16 def destination @destination ||= manager.stage!(stage_name) end |
#manager ⇒ Object
12 13 14 |
# File 'lib/gta/deploy.rb', line 12 def manager @manager ||= Manager.new(gta_config_path) end |
#source ⇒ Object
20 21 22 |
# File 'lib/gta/deploy.rb', line 20 def source @source ||= destination.source end |