Class: Lita::Handlers::SlackCircleciDeploy

Inherits:
Handler
  • Object
show all
Defined in:
lib/lita/handlers/slack_circleci_deploy.rb

Instance Method Summary collapse

Instance Method Details

#deploy_circle(response) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/lita/handlers/slack_circleci_deploy.rb', line 12

def deploy_circle(response)
  token = config.circleci_token
  CircleCi.configure do |config|
    config.token = token
  end

  build_environment_variables = { "QA_ENV" => response.matches[0][2] }
  build = CircleCi::Project.build_branch config.circleci_username, response.matches[0][1], response.matches[0][0], build_environment_variables

  response.reply("Starting build @ #{build.body['build_url']}")
end