Skip to content

Instantly share code, notes, and snippets.

@goldzulu
Created June 11, 2020 11:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goldzulu/8cd2bcdf26f1a25370326091bd6385b6 to your computer and use it in GitHub Desktop.
Save goldzulu/8cd2bcdf26f1a25370326091bd6385b6 to your computer and use it in GitHub Desktop.
A utility shell script to deploy only the Interaction Model skill package to the Alexa Developer Console.
#/bin/bash
# Written Originally by @VoiceTechGuy1 - GOLDZULU 2020-06-11
# Update the remote ADC Interaction Model with the locale ones
# Need to be located at the root of the alexa skill sdk project
# Please modify as needed to customize for your own needs
# Do not use it as is!
# use the get-skill-id.js file to get the skill id for the current alexa skill project
# check the blog at https://dzone.com/articles/syncing-local-alexa-skills-json-files-with-alexa-d
skillid=`node /Users/zoo/biggit/amazon/scripts/get-skill-id.js`
# set the s3 bucket to copy to
s3bucket="s3://space-conquest/"
# s3 base url
s3baseurl="https://space-conquest.s3.amazonaws.com/"
# set the expiry time for the file in s3 using the command date to generate the expiry time in the right UTC format
expiry="date -v+1d -u +%Y-%m-%dT23:59:00Z"
echo "Processing Skill-ID : ${skillid}"
# Copy the locales from the main locale e.g. en-US to other locales add as many locales as you want
cp skill-package/interactionModels/custom/en-US.json skill-package/interactionModels/custom/en-GB.json
# Zip up the skill package to prep up for deployment
cd skill-package
zip -r ../skill-package.zip ./*
cd -
# copy to the s3 bucket that you have access to and set the expiry date to tomorrow at 23:59 UTC
# modify the below s3 destination and the expiry date if needed
echo "Copying to S3..."
aws s3 cp ./skill-package.zip ${s3bucket} --acl public-read --expires `${expiry}`
# run the smapi command to import the sent zip file to replace the ADC interaction model version
echo "Updating the remote interaction model with the zip file content..."
ask smapi import-skill-package -s $skillid --location $s3baseurl\skill-package.zip --debug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment