Skip to content

Instantly share code, notes, and snippets.

@ck1125
Last active November 26, 2020 20:45
Show Gist options
  • Save ck1125/e309cef786480b8836869a4c5bb5c7a1 to your computer and use it in GitHub Desktop.
Save ck1125/e309cef786480b8836869a4c5bb5c7a1 to your computer and use it in GitHub Desktop.
Deploying RSK skill and its radio station catalogue
# Each time a deploy is triggered, the state is saved in a hidden file ask-states.json
# We use S3 Buckets to keep that in sync since the circle-ci container is stateless
# Get the latest deployment state from our S3 bucket ask-states.json
aws s3 cp s3://code-bucket/alexa-deployment/ask-states.json .ask/ask-states.json
# Deploy the Skill code with the ask cli (v2)
ask deploy -profile my-profile
# Save this new deployment state back to our S3 bucket
aws s3 cp .ask/ask-states.json s3://code-bucket/alexa-deployment/ask-states.json
# Upload the latest version of the radio stations catalog
skillId=$(cat .ask/ask-states.json | jq -r '.profiles."my-profile".skillId')
catalogId=$(ask smapi list-catalogs-for-vendor - profile my-profile | jq -r '.catalogs[] | select(.type == "AMAZON.TerrestrialRadioChannel") | select(.title == "Catalog Name") | .id')
ask smapi upload-catalog -c $catalogId -f ../catalog.json - profile my-profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment