Trying to deploy my Alexa Skill using Jovo CLI.
Any idea how to fix this error?
Command:
jovo deploy --stage dev --target lambda -p alexaSkill
Error:
[ERR] The security token included in the request is invalid.
Trying to deploy my Alexa Skill using Jovo CLI.
Any idea how to fix this error?
Command:
jovo deploy --stage dev --target lambda -p alexaSkill
Error:
[ERR] The security token included in the request is invalid.
I was able to solve this locally.
Local Solution:
ask configure
jovo deploy --stage dev --target lambda -p alexaSkill
jovo deploy --stage dev --target lambda -p alexaSkill --ask-profile profile-name
Still trying to figure out credentials in Gitlab CI/CI pipeline.
Stay tuned…
Here’s how to fix this on Gitlab CI/CD Pipelines.
Generate LWA token
ask util generate-lwa-tokens
to generate LWA token.Add Environment Variables to Gitlab
ASK_VENDOR_ID
ASK_REFRESH_TOKEN
(Found in LWA credentials above).Update Gitlab CI/CD YAML file
jovo deploy --stage dev -p alexaSkill --ask-profile __ENVIRONMENT_ASK_PROFILE__
__ENVIRONMENT_ASK_PROFILE__
ensures ask-cli uses environment variables for credentials instead of looking for credentials files.That should be all you need to do! If we missed something, tag @Voice_First and we will help you out.
Here’s the .gitlab-ci.yml
file we used:
stages:
- dev
- test
- production
# Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
image: <our-image>
# This folder is cached between builds
# http://docs.gitlab.com/ee/ci/yaml/README.html#cache
cache:
paths:
- ./assistant/node_modules/
dev:
stage: dev
script:
- cd assistant/
- npm set cache .npm
- npm test
- jovo build --stage dev -p alexaSkill
- jovo deploy --stage dev --target lambda -p alexaSkill
- jovo deploy --stage dev -p alexaSkill --ask-profile __ENVIRONMENT_ASK_PROFILE__
- jovo build --stage dev -p googleAction
- jovo deploy --stage dev -p googleAction
test:
stage: test
only:
refs:
- test
script:
- cd assistant/
- npm set cache .npm
- npm test
- jovo build --stage test -p alexaSkill
- jovo deploy --stage test --target lambda -p alexaSkill
- jovo deploy --stage test -p alexaSkill --ask-profile __ENVIRONMENT_ASK_PROFILE__
production:
stage: production
only:
refs:
- master
script:
- cd assistant/
- npm set cache .npm
- npm test
- jovo build --stage production -p alexaSkill
- jovo deploy --stage production --target lambda -p alexaSkill
- jovo deploy --stage production -p alexaSkill --ask-profile __ENVIRONMENT_ASK_PROFILE__