Alexa and Jenkins (Docker)

So I have an Alexa echo dot at home. Use it to control stuff but I wanted it to do more like release and deploy the stuff I build.
This is how you can integrate Alexa voice service with Jenkins.

First setup the server

For receiving commands from Alexa and sending them to Jenkins we need a server and some code. First start with the server i use docker and a docker-compose to set it up.




FROM ubuntu
MAINTAINER "Mattias Hemmingsson" <>
RUN apt-get update && apt-get install python-pip -y
RUN apt-get update && sudo apt-get install build-essential autoconf libtool pkg-config python-opengl python-imaging python-pyrex python-pyside.qtopengl idle-python2.7 qt4-dev-tools qt4-designer libqtgui4 libqtcore4 libqt4-xml libqt4-test libqt4-script libqt4-network libqt4-dbus python-qt4 python-qt4-gl libgle3 python-dev -y
RUN apt-get update &&  apt-get install libpq-dev python-dev libxml2-dev libxslt1-dev libldap2-dev libsasl2-dev libffi-dev -y
RUN pip install flask-ask python-jenkins
CMD python



build: .
- 5000:5000
- .:/code


then some code in the


from flask import Flask, render_template
from flask_ask import Ask, statement
import jenkins
app = Flask(__name__)
ask = Ask(app, '/')
def hello(app):
server = jenkins.Jenkins('http://jenkins:8080', username='admin', password='admin')
if str(app) == "rentalfront":
back = server.build_job('rentalfront')
print back
print "deploy rentalfront"
if str(app) == "farepaymnet":
print "Deploy farepaymnet"
return statement("Deploying {0}".format(app))
if __name__ == '__main__':'',debug=True)



And you will change the setitng so it matches you jenkins and alos change so correct word like rentalfront matches what you want to build.
We are going to say “alexa tell jenkins to build rentalfront” and then we ere matches rentalfront aginst the app you want to build.


start it up with


docker-compose build
docker-compose up


Now we need alexa to connect to you local laptop and connect go to and download and start it against port 5000

./ngrok http 5000

You will see a https link remember it


Set up Alexa

Time for setting up Alexa go to

Setup a new skill and give it name jenkins (This is the calling name “alexa tell jenkins” ) and the in the interactions model add the following


Intent Schema

"intents": [
"intent": "JenkinsIntent",
"name": "app",
"type": "Names"

where names are a custom slot type with the values rentalfront ADD YOUR APPS HERE THAT YOU WANT TO CALL

Sample Utterances


JenkinsIntent deploy {app}




Go to configuration and att the https link from ngrok



And go to SSL and choose Wildcard cert



And now you should be ready to start using it. go to the test and test write deploy rentalfront to see the json going from Alexa to you app and when it works it time to test from you echo.




  3 comments for “Alexa and Jenkins (Docker)

  1. Richard
    March 19, 2017 at 11:06 pm

    Wow, vad praktiskt, grymt

  2. December 26, 2017 at 7:11 pm

    where do we need to have the docker?

    • February 8, 2018 at 9:55 am


      You need to install docker on the computer you want to run the app on.
      Read more about docker here apt-get update &&

Leave a Reply

%d bloggers like this: