Class: GoDeploy::Deploy
- Inherits:
-
Object
- Object
- GoDeploy::Deploy
- Defined in:
- lib/go_deploy/deploy.rb
Overview
App go-deploy
Constant Summary collapse
- TMP_DIR =
'/tmp'.freeze
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize ⇒ Deploy
constructor
A new instance of Deploy.
- #run ⇒ Object
Constructor Details
#initialize ⇒ Deploy
Returns a new instance of Deploy.
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/go_deploy/deploy.rb', line 15 def initialize super begin = 'Please specify an order e.g.go-deploy production deploy or go-deploy production logs' @file_name = ARGV[0] @action = ARGV[1] puts .red and exit if @file_name.nil? && @action.nil? yaml_file = File.join(Dir.pwd, "#{@file_name}.yaml") self.config = YAML.load_file(yaml_file) @console = Console.new(config) @service = config['service'] rescue StandardError => e puts e..red exit end end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
13 14 15 |
# File 'lib/go_deploy/deploy.rb', line 13 def config @config end |
Instance Method Details
#run ⇒ Object
34 35 36 37 38 39 40 41 |
# File 'lib/go_deploy/deploy.rb', line 34 def run case @action.upcase when 'DEPLOY' deploy_go when 'LOGS' logs end end |