jhnferraris
jhnferraris

Reputation: 1401

Alexa configuration deployment (staging and product) practice

Hello I am new to Alexa Skill Kit deployment using ask-cli. I just want to know if there are any deployment practices in place where we have different configurations i.e skills.json and .ask/config

For example, I have a repository some-alexa-skill with 2 branches: staging and production.

staging has this configuration for the skills.json

{
  "skillManifest": {
    "publishingInformation": {
      "locales": {
        "en-US": {
          "name": "staging"
        }
      },
      "isAvailableWorldwide": true,
      "distributionCountries": []
    },
    "apis": {
      "custom": {
        "endpoint": {
          "uri": "staging",
          "sourceDir": "lambda/custom"
        }
      }
    },
    "manifestVersion": "1.0"
  }
}

while production has this:

{
  "skillManifest": {
    "publishingInformation": {
      "locales": {
        "en-US": {
          "name": "production"
        }
      },
      "isAvailableWorldwide": true,
      "distributionCountries": []
    },
    "apis": {
      "custom": {
        "endpoint": {
          "uri": "production",
          "sourceDir": "lambda/custom"
        }
      }
    },
    "manifestVersion": "1.0"
  }
}

As I can observe skill.json should be "ignored" in the git respository since it will be replaced whenever merges occur during "release to production". I'm thinking of just ignoring skills.json and just change it when I want to deploy. But I am also considering the ability to allow others to deploy it in their own machines.

Any suggestions on how should I approach this using ask-cli?

Upvotes: 0

Views: 325

Answers (1)

Ron Lisle
Ron Lisle

Reputation: 1164

Using the API should allow you to control your source and target destinations however you like. Using "profiles" will allow you to keep separate sets of credentials also.

There are 2 different levels of control when using the ask-cli. One is high level, and simplifies creating, cloning, and updating skills. These use the format:

  • "ask new ..." or "ask clone" to create or copy an existing skill
  • "ask deploy ..." to update parts or all of the skill.

A lower level API is available that allows more specific control. These use the format "ask api ..." and allow you to specify for example the specific file to upload/download to/from. I've found these better for projects with staging, develop, testing branches, etc.

In all of the ask commands, you can provide a profile that specifies the credentials for the Alexa developer account and the AWS account for the Lambda. Use the "ask init" to set these up. I keep separate profiles for:

  • my home/hobby projects using my personal accounts
  • my work related development/debugging
  • my work client projects accessible by our testers and clients.

The Amazon doc is pretty well written, and explains how to use the ask-cli. It just doesn't go into why you would use multiple profiles, etc.

I hope this helps. Start with the Amazon ask-cli quick start then follow the links to the reference documentation.

One thing to be careful about is to make sure that you are using the latest ask-cli download. As of today it is 1.0.0-beta.4. You can use the "ask -v" command to display your installed version. There were problems with the deploy command in the earlier 1.0.0-beta.1 version.

Upvotes: 2

Related Questions