Class: DeployDocus::Deployer
- Inherits:
-
Object
- Object
- DeployDocus::Deployer
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/deploy_docus/deployer.rb
Instance Attribute Summary collapse
-
#deploy_task ⇒ Object
readonly
Returns the value of attribute deploy_task.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#ssh_key ⇒ Object
readonly
Returns the value of attribute ssh_key.
-
#wrapper ⇒ Object
Returns the value of attribute wrapper.
Instance Method Summary collapse
- #deploy! ⇒ Object
-
#initialize(repository, ssh_key, deploy_task) ⇒ Deployer
constructor
Manages cloning and deploying the repository This class is agnostic of any web interface and can be used as a library.
Constructor Details
#initialize(repository, ssh_key, deploy_task) ⇒ Deployer
Manages cloning and deploying the repository This class is agnostic of any web interface and can be used as a library
DeployDocus::Deployer(“[email protected]:evome/evome.git”, “~/.ssh/evome_key”, “cap staging deploy”)
It will clone the repository in a random directory located in /tmp. And execute the deploy_task on it.
24 25 26 27 |
# File 'lib/deploy_docus/deployer.rb', line 24 def initialize(repository, ssh_key, deploy_task) ssh_key = File.(ssh_key) if ssh_key @repository, @ssh_key, @deploy_task = repository, ssh_key, deploy_task end |
Instance Attribute Details
#deploy_task ⇒ Object (readonly)
Returns the value of attribute deploy_task.
8 9 10 |
# File 'lib/deploy_docus/deployer.rb', line 8 def deploy_task @deploy_task end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
8 9 10 |
# File 'lib/deploy_docus/deployer.rb', line 8 def repository @repository end |
#ssh_key ⇒ Object (readonly)
Returns the value of attribute ssh_key.
8 9 10 |
# File 'lib/deploy_docus/deployer.rb', line 8 def ssh_key @ssh_key end |
#wrapper ⇒ Object
Returns the value of attribute wrapper.
9 10 11 |
# File 'lib/deploy_docus/deployer.rb', line 9 def wrapper @wrapper end |
Instance Method Details
#deploy! ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/deploy_docus/deployer.rb', line 29 def deploy! if self.valid? GitSSHWrapper.with_wrapper(:private_key_path => ssh_key) do |w| @wrapper = w clone && run_deploy end else false end end |