codeforboston / voiceapp311

Voice assistant connection to Boston services
MIT License
40 stars 47 forks source link

Update to use ask CLI v2 #334

Closed jmartini closed 4 years ago

jmartini commented 4 years ago

This updates the project to use ASK CLI v2 and should allow easier onboarding, deploying, and testing of the project. I made our deploy tools compatible with these changes, so the continuous deployment scripts should continue to work for our production server, but developers should prefer using ask deploy.

Closed #328

Here would be the proposed update to the onboarding wiki:

Installation Overview

In order to create an Alexa skill we need to configure two main components:

  1. The Alexa skill itself.
  2. An Amazon Web Service (AWS) lambda function to run our application logic. (If you don't have an AWS account, sign up for one at https://aws.amazon.com)

Luckily, most of the configuration can be done through the Alexa Skills Kit Command Line Interface (ASK CLI). To get set up with ASK CLI follow septs 1-3 of the ASK CLI quick start guide. Make sure you do all of step 1, including signing up for a developer account, all of step 2, including creating AWS credentials since we are using AWS lambda to host our skills, and run ask configure in step 3.

Once completed, clone the repo and run ask deploy from inside the repo. If all goes well, you should successfully deploy the skill.

In order to test the skill, you can use the command line ask dialog. Try running opening the skill in the dialog console by typing "open boston info".

If you want to test and hear the audio back, you can use the web interface in the "Alexa Developer Console"

After deploying, one additional thing you need to set up manually is add some environment variables to our lambda function. Log into your AWS account and select "Lambda" under services. You should now see a lambda function that starts with "ask-bostoninfo". Click on this lambda function, and scroll down to Environment variables. Add the following:

jmartini commented 4 years ago

The current failing unit test (below) is being fixed in PR #333 . Going to merge this now since it will help people with onboarding.

======================================================================
FAIL: test_returns_valid_text (integration_tests.test_coronavirus_intent.CoronavirusIntentTestCase)
----------------------------------------------------------------------