SlideShare a Scribd company logo
1 of 16
Download to read offline
Hubot Deployments from
HipChat
Trust, Transparency & Teamwork
@danackerson

BASIC programming
and debugging

Network Security &
H/W Troubleshooting
Hubot

http://hubot.github.com
Hipchat integration
$ npm install hubot
$ vi /etc/init.d/hubot
start_hubot() {
sudo -u $HBT_USER -i -- <<EOF
export HUBOT_HIPCHAT_JID='12345_678901@chat.hipchat.com'
export HUBOT_HIPCHAT_PASSWORD='<supersecretpasswd>'
export HUBOT_HIPCHAT_TOKEN='<supersecrettoken>'
export HUBOT_HIPCHAT_ROOMS='13579_stylight@conf.hipchat.com'
export HUBOT_AUTH_ADMIN='123970,459837,512833'
export PORT=8887
$HBT_DIR/$HBT_BIN -a hipchat > /home/$HBT_USR/hubot.log 2>&1 &
is based on a culture of trust

-- Ernest
Hemingway
Deployment
Broadcast & control releases
{spawn, exec} = require 'child_process'
exec_cmd = "fab release:commit='#{sha}',servers='#{servers}'"
",changelog="#{changelog}",keep_disabled=#{keep_disabled}"
cmd_str = "eval `ssh-agent` && ssh-add && cd #{deploy_dir} "
&& #{exec_cmd} > #{home_dir}/deploys/#{current_date}.log 2>&1"
exec cmd_str, (err, stdout, stderr) ->
if err msg.reply "Sorry, something has gone wrong: #{err}"
else exec "rm #{home_dir}/deploys/current.lock && killall ssh-agent"
demands transparency
Ensure quality
if test_deployment and !github_release_id
msg.http("http://10.0.0.25:8081/job/00_hubot_deployment/
buildWithParameters?token=<jenkinstoken>&GIT_COMMIT=#{sha}")
.get()
Deployment
Jenkins measures
github release
Putting the pieces together
msg.http("https://api.github.com/repos/stylight/stylight-web/releases")
.headers( 'Authorization': "token <GIT_API_TOKEN>",
'User-Agent': "Stybot" )
.get() (err, res, body) ->
for release in JSON.parse body
if release['target_commitish'][0..6] == sha[0..6]
github_release_id = release['id']
if live_deployment and !github_release_id
msg.reply 'WARN: ' + sha[0..6] + ' has no passing tests!'
Hold ourselves accountable
… because teamwork!
Individuals and interactions

More Related Content

Similar to Hubot Deployments at Stylight

Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison DowdneySetting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Weaveworks
 
Cracking Into Embedded Devices - HACK.LU 2K8
Cracking Into Embedded Devices - HACK.LU 2K8Cracking Into Embedded Devices - HACK.LU 2K8
Cracking Into Embedded Devices - HACK.LU 2K8
guest441c58b71
 

Similar to Hubot Deployments at Stylight (20)

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
uygulamalarla siber güvenlik-siber guvenlik haftasi.pptx
uygulamalarla siber güvenlik-siber guvenlik haftasi.pptxuygulamalarla siber güvenlik-siber guvenlik haftasi.pptx
uygulamalarla siber güvenlik-siber guvenlik haftasi.pptx
 
Growing HashiCorp Vault at Hootsuite
Growing HashiCorp Vault at HootsuiteGrowing HashiCorp Vault at Hootsuite
Growing HashiCorp Vault at Hootsuite
 
Nat mikrotik
Nat mikrotikNat mikrotik
Nat mikrotik
 
3-sdn-lab.pdf
3-sdn-lab.pdf3-sdn-lab.pdf
3-sdn-lab.pdf
 
IoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3BIoT with openHAB on pcDuino3B
IoT with openHAB on pcDuino3B
 
Android Bluetooth Introduction
Android Bluetooth IntroductionAndroid Bluetooth Introduction
Android Bluetooth Introduction
 
Online machine Learning with Divolte
Online machine Learning with DivolteOnline machine Learning with Divolte
Online machine Learning with Divolte
 
Prototyping online ML with Divolte Collector
Prototyping online ML with Divolte CollectorPrototyping online ML with Divolte Collector
Prototyping online ML with Divolte Collector
 
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSHTame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
 
Build Your Own HiveMQ Extension
Build Your Own HiveMQ ExtensionBuild Your Own HiveMQ Extension
Build Your Own HiveMQ Extension
 
Gorush: A push notification server written in Go
Gorush: A push notification server written in GoGorush: A push notification server written in Go
Gorush: A push notification server written in Go
 
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison DowdneySetting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
Setting up Notifications, Alerts & Webhooks with Flux v2 by Alison Dowdney
 
Configurare https mule
Configurare https muleConfigurare https mule
Configurare https mule
 
Build resource server &amp; client for OCF Cloud (2018.8.30)
Build resource server &amp; client for OCF Cloud (2018.8.30)Build resource server &amp; client for OCF Cloud (2018.8.30)
Build resource server &amp; client for OCF Cloud (2018.8.30)
 
Bastion jump hosts with Teleport
Bastion jump hosts with TeleportBastion jump hosts with Teleport
Bastion jump hosts with Teleport
 
How to create a secured multi tenancy for clustered ML with JupyterHub
How to create a secured multi tenancy for clustered ML with JupyterHubHow to create a secured multi tenancy for clustered ML with JupyterHub
How to create a secured multi tenancy for clustered ML with JupyterHub
 
Time Series Database and Tick Stack
Time Series Database and Tick StackTime Series Database and Tick Stack
Time Series Database and Tick Stack
 
Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)Python from zero to hero (Twitter Explorer)
Python from zero to hero (Twitter Explorer)
 
Cracking Into Embedded Devices - HACK.LU 2K8
Cracking Into Embedded Devices - HACK.LU 2K8Cracking Into Embedded Devices - HACK.LU 2K8
Cracking Into Embedded Devices - HACK.LU 2K8
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Hubot Deployments at Stylight

  • 1. Hubot Deployments from HipChat Trust, Transparency & Teamwork
  • 4. Hipchat integration $ npm install hubot $ vi /etc/init.d/hubot start_hubot() { sudo -u $HBT_USER -i -- <<EOF export HUBOT_HIPCHAT_JID='12345_678901@chat.hipchat.com' export HUBOT_HIPCHAT_PASSWORD='<supersecretpasswd>' export HUBOT_HIPCHAT_TOKEN='<supersecrettoken>' export HUBOT_HIPCHAT_ROOMS='13579_stylight@conf.hipchat.com' export HUBOT_AUTH_ADMIN='123970,459837,512833' export PORT=8887 $HBT_DIR/$HBT_BIN -a hipchat > /home/$HBT_USR/hubot.log 2>&1 &
  • 5. is based on a culture of trust -- Ernest Hemingway
  • 7. Broadcast & control releases {spawn, exec} = require 'child_process' exec_cmd = "fab release:commit='#{sha}',servers='#{servers}'" ",changelog="#{changelog}",keep_disabled=#{keep_disabled}" cmd_str = "eval `ssh-agent` && ssh-add && cd #{deploy_dir} " && #{exec_cmd} > #{home_dir}/deploys/#{current_date}.log 2>&1" exec cmd_str, (err, stdout, stderr) -> if err msg.reply "Sorry, something has gone wrong: #{err}" else exec "rm #{home_dir}/deploys/current.lock && killall ssh-agent"
  • 9. Ensure quality if test_deployment and !github_release_id msg.http("http://10.0.0.25:8081/job/00_hubot_deployment/ buildWithParameters?token=<jenkinstoken>&GIT_COMMIT=#{sha}") .get()
  • 13. Putting the pieces together msg.http("https://api.github.com/repos/stylight/stylight-web/releases") .headers( 'Authorization': "token <GIT_API_TOKEN>", 'User-Agent': "Stybot" ) .get() (err, res, body) -> for release in JSON.parse body if release['target_commitish'][0..6] == sha[0..6] github_release_id = release['id'] if live_deployment and !github_release_id msg.reply 'WARN: ' + sha[0..6] + ' has no passing tests!'