5

Is it possible to use Alexa Skill Kit's ASK CLI deploy command to build, for example, a debug version of the app that deploys a development environment and a release version of the app that deploys to a test environment?

My team and I are trying to deploy the same skill to two different environments, so our testing team can do their thing in the test environments and development can do their thing in the development environment.

This will be a private skill so using http://developer.amazon.com separation of test and "prod" via publishing the application is not an option.

Cole
  • 676
  • 8
  • 24
  • Hard to say. The documentation is written in Martian. – Roamer-1888 Mar 14 '18 at 20:31
  • 1
    Hehe... for now, I wrote a bash script that copies in files that have test configurations in it, runs `ask deploy`, then backs out those test configurations when `ask deploy` is finished. – Cole Mar 14 '18 at 21:41

1 Answers1

2

There are probably a lot of ways to accomplish this. Here are some that immediately come to mind:

  1. Pull your different settings from the environment or a separate file, for example a .env file.
  2. You could also use separate accounts for debug and release, and 'share' the common code between them.
  3. Do as you mention in your comment and use a bash (or npm) to configure as needed.

Personally, I like the npm approach a bit better, but have used bash successfully to do this also. You don't mention which language you are using for you Lambda. I'm working with Javascript, so npm is a good fit for me.

Note also that you can use the AWS CLI for handling your lambda in addition to the ASK CLI.

Ron Lisle
  • 1,164
  • 6
  • 11
  • Great suggestions Ron! As you said I ended up using `bash` to copy configurations in and out for a "release" build. We're using `node` for our lamda. – Cole Mar 16 '18 at 16:17
  • Node is awesome. I use Mocha for unit testing my Lambdas locally (npm test) before even uploading them to AWS. – Ron Lisle Mar 18 '18 at 11:49
  • One other comment. Since the code resides in a Lambda, you can take advantage of a couple very cool features of AWS Lambda: 1. Versioning - each Lambda can be 'versioned', which makes it immutable and gives it a unique numbered name (eg myLambda:1) 2. Aliases - you can define a Lambda ARN alias that points to whichever other Lambda you choose. So create test and prod aliases, and then point them to the Lambdas (hopefully versioned?) associate with each stage. – Ron Lisle Mar 22 '18 at 16:53