DevOps Your Skill
Join the DZone community and get the full member experience.Join For Free
Xavi speaks today at the Agile + DevOps Virtual Summit. Ready to DevOps your Alexa Skills? Don't miss it!
"DevOps is the union of people, process, and products to enable continuous delivery of value to our end users." - Donovan Brown, Microsoft
DevOps is a "culture", which has a set of practices that combine software development (Dev) and information-technology operations (Ops), which aims to shorten the systems development life cycle and provide continuous delivery with high software quality. DevOps culture develops "production-first mindset". In terms of Alexa, DevOps can help us to quickly ship the highest quality of our Skill to the end customers.
This post contains materials from different resources that can be seen on Resources section.
Here you have the technologies used in this project
- Amazon Developer Account — How to get it.
- AWS Account — Sign up here for free.
- ASK CLI — Install and configure ASK CLI.
- CircleCI Account — Sign up here.
- Visual Studio Code.
The Alexa Skills Kit Command Line Interface (ASK CLI) is a tool for you to manage your Alexa skills and related resources, such as AWS Lambda functions. With ASK CLI, you have access to the Skill Management API, which allows you to manage Alexa skills programmatically from the command line. If you want how to create your Skill with the ASK CLI, please follow the first step explained in my Node.js Skill sample. We are going to use this powerful tool to do some steps in our pipeline.
Before explaining the pipeline, it is important to explain the Docker image we are going to use in this pipeline. You can find all the explanations in this post.
Before explaining the pipeline, it is worth noting the common part of the pipeline, the executor. An executor defines the underlying technology or environment in which to run a job. Set up your jobs to run in Docker, a machine, macOS, or Windows executor and specify an image with the tools and packages you need. In our case, we will use a docker executor using the docker image explained above:
Let's explain job-by-job what is happening in our powerful pipeline. First of all, each box represented in the image above is a job, and they will be defined below the
job node in the CircleCI configuration file:
The checkout job will execute the following tasks:
- Check out the code in
- Bring execution permission to
nodeuser to be able to execute all the hooks.
- Persist the code in order to reuse it in the next job.
The build job will execute the following tasks:
- Restore the code that we have downloaded in the previous step in
npm installin order to download all the Node.js dependencies.
- Persist again the code that we will reuse in the next job.
The pretest job will execute the static code quality check. Check the full explanation here.
The test job will execute the unit tests. Check the full explanation here.
The codecov job will execute the code coverage report. Check the full explanation here.
The deploy job will deploy the Alexa Skill to the Alexa cloud in the development stage. Check the full explanation here.
Testing the Voice User Interface
These jobs will check our interaction model. Check the full explanation here.
These jobs will check the interaction model and our backend as well. Check the full explanation here.
End to end tests
These jobs will check the full system using the voice as input. Check the full explanation here.
These jobs will validate your Alexa Skill before submitting it to certification. Check the full explanation here.
The store-artifacts job will execute the following tasks:
- Restore the code that we have used in the previous step in
- Store the entire code of our Alexa Skill as an artifact. It will be accessible in CircleCI whenever we want to check it out.
Wait for Approval
For times when you'd prefer to keep manual approvals in place, easily configure the manual approval process by adding to your workflow a special job containing a
type: approvalentry. This job it is needed in order to check whatever you want of your Alexa Skill before submitting it to certification and when everything is checked, you can approve or decline the execution.
This job is a different job that only exists down the
workflows node in the config file. It is not needed to add it as a
These jobs will submit your Alexa Skill to certification. Check the full explanation here.
At the end of the CircleCi configuration file, we will define our pipeline as a CircleCI Workflow, which will execute the jobs explained above:
The CircleCI configuration file is located in
- Official Alexa Skills Kit Node.js SDK — The Official Node.js SDK Documentation.
- Official Alexa Skills Kit Documentation — Official Alexa Skills Kit Documentation.
- Official CircleCI Documentation — Official CircleCI Documentation.
This is the first step to know how to DevOps your Alexa Skills using CircleCI. As you have seen in this example, the Alexa Tools like ASK CLI can help us a lot.
I hope this example project is useful to you.
That’s all, folks!
You can find the code in my GitHub.
I hope it will be useful! If you have any doubts or questions, do not hesitate to contact me or put a comment below.
Opinions expressed by DZone contributors are their own.