{{announcement.body}}
{{announcement.title}}

DevOps Your Skill: Submit

DZone 's Guide to

DevOps Your Skill: Submit

In this article, we discuss how to send to certification your Alexa Skill in your pipeline and its importance in the day-to-day Alexa Skills development.

· DevOps Zone ·
Free Resource

This is the last step of our pipeline. Previously we have run a lot of different tests and if everything is ok, it is time to submit our Alexa Skill to certification. It means, we have concluded the Continuous integration part, it is time to Continuous Deployment.

These step are automated in the continuous integration system (CircleCI) and are executed in each new version of the software.

Prerequisites

Here you have the technologies used in this project

  1. ASK CLI - Install and configure ASK CLI
  2. CircleCI Account - Sign up here
  3. Node.js v10.x
  4. Visual Studio Code

ASK CLI (Alexa Skill Kit CLI)

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. We will use this powerful tool to validate our Alexa Skill. Let's start!

Installation

The ASK CLI is included in the Docker image we are using so it is not necessary to install anything else.

Submit

In this step of the pipeline we are going to submit our Alexa Skill using the ASK CLI. When you submit your skill to the Alexa Store, it must pass a certification process from Amazon staff before it can be published live to Amazon customers. We can use the following commands in the Skill Management API (SMAPI) to manage the certification and publication of an Alexa skill. In our case, we will only submit to certificate and not publishing it automatically, just certify.

  1. For ask cli v1:
Shell
 




x


 
1
ask api submit -s ${skill_id} --publication-method MANUAL_PUBLISHING


  1. For ask cli v2:
Shell
 




xxxxxxxxxx
1


 
1
ask smapi submit-skill-for-certification -s ${skill_id} --publication-method MANUAL_PUBLISHING


Those commands are integrated in the bash script file test/submit/submit.sh.

Here you can find the full bash script:

Shell
 




x
15


1
    #!/bin/bash
2
    skill_id=$1
3
 
          
4
    cli_version=$2
5
 
          
6
    echo "######### Submiting Skill for certification without publishing #########"
7
 
          
8
    if [[ ${cli_version} == *"v1"* ]]
9
    then
10
        submit=$(ask api submit -s ${skill_id} --publication-method MANUAL_PUBLISHING)
11
        exit 0
12
    else
13
        submit=$(ask smapi submit-skill-for-certification -s ${skill_id} --publication-method MANUAL_PUBLISHING)
14
        exit 0
15
    fi


This script has two parameters:

  1. The id of the skill
  2. The version of the ASK CLI you are running (v1 or v2).

Reports

There are not reports defined in this job.

But we can see in the Alexa Developer Console the new status of our Alexa Skill in the Certification tab:

Alexa Skill

Integration

It is not necessary to integrate it in package.json file.

Pipeline Job

Everything is ready to submit our Alexa Skill, let's add it to our pipeline!

This job will execute the following tasks:

  1. Restore the code that we have downloaded in the previous step in /home/node/project folder
  2. Run the submit script.
YAML
 




x


1
  submit:
2
    executor: ask-executor
3
    steps:
4
      - attach_workspace:
5
          at: /home/node/
6
      - run: cd test/submit/ && ./submit.sh $SKILL_ID v1


NOTE: To perform these tests in CircleCI you have to set the environment variable SKILL_ID with the id of your Alexa Skill.

Resources

Conclusion

Thanks to the ASK CLI we can perform this complex task. This is the end, thank you for reading it until here!

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.

Happy coding!

Topics:
alexa, alexa skill, alexa skill development, alexa skills, alexa skills developer, alexa skills development, cicd, continuous deployment, devops

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}