Class: Kybus::CLI::Deployer
- Inherits:
-
Object
- Object
- Kybus::CLI::Deployer
- Defined in:
- lib/kybus/cli/bot/deployer.rb
Constant Summary collapse
- DEFAULT_CONFIGS =
{ 'repo_path' => '.', 'output_path' => './.kybusbotcode.zip' }.freeze
Instance Method Summary collapse
- #compress_repo! ⇒ Object
- #config_with_options ⇒ Object
- #deploy_lambda! ⇒ Object
- #destroy ⇒ Object
-
#initialize(options) ⇒ Deployer
constructor
A new instance of Deployer.
- #load_kybusdeploy_file! ⇒ Object
- #run ⇒ Object
- #run_migrations! ⇒ Object
Constructor Details
#initialize(options) ⇒ Deployer
Returns a new instance of Deployer.
27 28 29 30 31 32 |
# File 'lib/kybus/cli/bot/deployer.rb', line 27 def initialize() @params = load_kybusdeploy_file! @telegram = ::Kybus::CLI::BotDeployerTelegramConfigurator.new(@url, ) @lambda = ::Kybus::CLI::AWSBotDeployer.new() end |
Instance Method Details
#compress_repo! ⇒ Object
48 49 50 51 |
# File 'lib/kybus/cli/bot/deployer.rb', line 48 def compress_repo! code = ::Kybus::AWS::CodePackager.new() code.create_or_update! end |
#config_with_options ⇒ Object
44 45 46 |
# File 'lib/kybus/cli/bot/deployer.rb', line 44 def @config_with_options ||= DEFAULT_CONFIGS.merge(@config.merge(@params)) end |
#deploy_lambda! ⇒ Object
53 54 55 56 |
# File 'lib/kybus/cli/bot/deployer.rb', line 53 def deploy_lambda! @lambda.create_or_update! @telegram.url = @lambda.url end |
#destroy ⇒ Object
64 65 66 67 |
# File 'lib/kybus/cli/bot/deployer.rb', line 64 def destroy @lambda.destroy! @telegram.destroy! end |
#load_kybusdeploy_file! ⇒ Object
40 41 42 |
# File 'lib/kybus/cli/bot/deployer.rb', line 40 def load_kybusdeploy_file! @config = YAML.load_file('./kybusbot.yaml') end |
#run ⇒ Object
58 59 60 61 62 |
# File 'lib/kybus/cli/bot/deployer.rb', line 58 def run compress_repo! deploy_lambda! @telegram.create_or_update! end |
#run_migrations! ⇒ Object
34 35 36 37 38 |
# File 'lib/kybus/cli/bot/deployer.rb', line 34 def run_migrations! Rake::Task.clear load 'Rakefile' Rake::Task['db:migrate'].invoke end |