Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgraded to latest go, goreleaser, modules. Started to add some exam… #1

Merged
merged 1 commit into from
Sep 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
98 changes: 11 additions & 87 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ builds:
goos:
- darwin
- linux
- windows
goarch:
- amd64
- 386
Expand All @@ -31,6 +32,7 @@ archives:
replacements:
darwin: Darwin
linux: Linux
windows: Windows

# Can be used to change the archive formats for specific GOOSs.
# Most common use case is to archive as zip on Windows.
Expand All @@ -48,92 +50,14 @@ changelog:
exclude:
- '^docs:'
- '^test:'
brews:
-
tap:
owner: sethkor
name: homebrew-tap
folder: Formula
description: "Fast S3 Tools built in GoLang Using Multiparts and Concurrency"
test: |
system "#{bin}/program --version"


brew:
# Name template of the recipe
# Default to project name
name: lexbelt

# Repository to push the tap to.
github:
owner: sethkor
name: homebrew-tap

# Template for the url.
# Default is "https://github.com/<repo_owner>/<repo_name>/releases/download/{{ .Tag }}/{{ .ArtifactName }}"
#url_template: "http://github.mycompany.com/foo/bar/releases/{{ .Tag }}/{{ .ArtifactName }}"

# Allows you to set a custom download strategy.
# Default is empty.
#download_strategy: GitHubPrivateRepositoryReleaseDownloadStrategy

# Allows you to add a custom require_relative at the top of the formula template
# Default is empty
#custom_require: custom_download_strategy

# Git author used to commit to the repository.
# Defaults are shown.
commit_author:
name: goreleaserbot
email: goreleaser@carlosbecker.com

# Folder inside the repository to put the formula.
# Default is the root folder.
folder: Formula

# Caveats for the user of your binary.
# Default is empty.
#caveats: "How to use this binary"

# Your app's homepage.
# Default is empty.
homepage: "https://github.com/sethkor/lexbelt/"

# Your app's description.
# Default is empty.
description: "cli tools for AWS Lex"

# Setting this will prevent goreleaser to actually try to commit the updated
# formula - instead, the formula file will be stored on the dist folder only,
# leaving the responsibility of publishing it to the user.
# If set to auto, the release will not be uploaded to the homebrew tap
# in case there is an indicator for prerelease in the tag e.g. v1.0.0-rc1
# Default is false.
#skip_upload: true

# Custom block for brew.
# Can be used to specify alternate downloads for devel or head releases.
# Default is empty.
#custom_block: |
# head "https://github.com/some/package.git"
# ...

# Packages your package depends on.
#dependencies:
# - git
# - zsh

# Packages that conflict with your package.
#conflicts:
# - svn
# - bash

# Specify for packages that run as a service.
# Default is empty.
#plist: |
# <?xml version="1.0" encoding="UTF-8"?>
# ...

# So you can `brew test` your formula.
# Default is empty.
test: |
system "#{bin}/program --version"
# ...

# Custom install script for brew.
# Default is 'bin.install "program"'.
#install: |
# bin.install "program"
# ...

5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
mac:
env GOOS=darwin GOARCH=amd64 go build -o lexbelt.mac
env GOOS=darwin GOARCH=amd64 go build -o lexbelt

linux:
env GOOS=linux GOARCH=amd64 go build -o lexbelt.linux
Expand All @@ -10,3 +10,6 @@ clean:

publish-test:
goreleaser --snapshot --skip-publish --rm-dist

publish:
goreleaser --rm-dist --skip-validate
35 changes: 34 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,34 @@
# lexbelt
# lexbelt
A tool to provision Amazon Lex using YAML or JSON

Amazon Lex is amazing, except it has very low automation. There's no CloudFormation for it CFN for it.

Also, when trying to create or update anything, the CLI wants you to pass in a checksum so it can figure out if it needs to update or create, this can be annoying.

Lexbelt fixes all this.

```
usage: lexbelt [<flags>] <command> [<args> ...]

AWS Lex CLI utilities

Flags:
-h, --help Show context-sensitive help (also try --help-long and --help-man).
--profile=PROFILE AWS credentials/config file profile to use
--region=REGION AWS region
--verbose Verbose Logging - not implemented yet
-v, --version Show application version.

Commands:
help [<command>...]
Show help.

put-slot-type --name=NAME <file>
Adds or updates a slot type

put-intent --name=NAME <file>
Adds or updates an intent

put-bot --name=NAME [<flags>] <file>
Adds or updates a bot
```
31 changes: 31 additions & 0 deletions examples/json/bots/OrderFlowersBot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"intents": [
{
"intentVersion": "$LATEST",
"intentName": "OrderFlowers"
}
],
"name": "OrderFlowersBot",
"locale": "en-US",
"abortStatement": {
"messages": [
{
"content": "Sorry, I'm not able to assist at this time",
"contentType": "PlainText"
}
]
},
"clarificationPrompt": {
"maxAttempts": 2,
"messages": [
{
"content": "I didn't understand you, what would you like to do?",
"contentType": "PlainText"
}
]
},
"voiceId": "Salli",
"childDirected": false,
"idleSessionTTLInSeconds": 600,
"description": "Bot to order flowers on the behalf of a user"
}
19 changes: 19 additions & 0 deletions examples/json/intents/AskTime.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "AskTime",
"description": "Intent to ask what the time is",
"version": "1",
"sampleUtterances": [
"Whats the time",
"What time is it",
"Time please",
"Time"
],
"slots": [],
"fulfillmentActivity": {
"codeHook": {
"uri": "arn:aws:lambda:us-west-2:166330533654:function:LexLambdaSampleFulfilment",
"messageVersion": "1.0"
},
"type": "CodeHook"
}
}
82 changes: 82 additions & 0 deletions examples/json/intents/OrderFlowers.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"name": "OrderFlowers",
"description": "Intent to order a bouquet of flowers for pick up",
"sampleUtterances": [
"I would like to pick up flowers",
"I would like to order some flowers"
],
"slots": [
{
"slotType": "FlowerTypes",
"name": "FlowerType",
"slotConstraint": "Required",
"valueElicitationPrompt": {
"maxAttempts": 2,
"messages": [
{
"content": "What type of flowers would you like to order?",
"contentType": "PlainText"
}
]
},
"priority": 1,
"slotTypeVersion": "$LATEST",
"sampleUtterances": [
"I would like to order {FlowerType}"
],
"description": "The type of flowers to pick up"
},
{
"slotType": "AMAZON.DATE",
"name": "PickupDate",
"slotConstraint": "Required",
"valueElicitationPrompt": {
"maxAttempts": 2,
"messages": [
{
"content": "What day do you want the {FlowerType} to be picked up?",
"contentType": "PlainText"
}
]
},
"priority": 2,
"description": "The date to pick up the flowers"
},
{
"slotType": "AMAZON.TIME",
"name": "PickupTime",
"slotConstraint": "Required",
"valueElicitationPrompt": {
"maxAttempts": 2,
"messages": [
{
"content": "Pick up the {FlowerType} at what time on {PickupDate}?",
"contentType": "PlainText"
}
]
},
"priority": 3,
"description": "The time to pick up the flowers"
}
],
"confirmationPrompt": {
"maxAttempts": 2,
"messages": [
{
"content": "Okay, your {FlowerType} will be ready for pickup by {PickupTime} on {PickupDate}. Does this sound okay?",
"contentType": "PlainText"
}
]
},
"rejectionStatement": {
"messages": [
{
"content": "Okay, I will not place your order.",
"contentType": "PlainText"
}
]
},
"fulfillmentActivity": {
"type": "ReturnIntent"
}
}
16 changes: 16 additions & 0 deletions examples/json/slots/FlowerTypes.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "FlowerTypes",
"description": "Types of flowers to pick up",
"enumerationValues": [
{
"value": "tulips"
},
{
"value": "lilies"
},
{
"value": "roses"
}
]
}

13 changes: 13 additions & 0 deletions examples/yaml/bots/AskTime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Talking Clock
description: A Lex bot that tells you the time
locale: en-US
voiceId: Salli
childDirected: false
idleSessionTTLInSeconds: 600
intents:
- intentName: AskTime
intentVersion: $LATEST
abortStatement:
messages:
- content: Sorry, I can't help you right now
contentType: PlainText
20 changes: 20 additions & 0 deletions examples/yaml/bots/TalkingClock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Another Clock
description: A Lex bot that tells you the time
locale: en-US
voiceId: Salli
childDirected: false
idleSessionTTLInSeconds: 600
intents:
- intentName: AskTime
intentVersion: $LATEST
- intentName: AskDay
intentVersion: $LATEST
clarificationPrompt:
maxAttempts: 3
messages:
- content: Sorry, I don't understand what you would like to do
contentType: PlainText
abortStatement:
messages:
- content: Sorry, I can't help you right now
contentType: PlainText
13 changes: 13 additions & 0 deletions examples/yaml/intents/AskDay.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: AskDay
description: Intent to ask what the day is
version: 1
sampleUtterances:
- 'Whats the day'
- 'What day is it'
- 'Day please'
- 'Four'
fulfillmentActivity:
codeHook:
uri: arn:aws:lambda:us-west-2:166330533654:function:LexLambdaSampleFulfilment
messageVersion: "1.0"
type: CodeHook
12 changes: 12 additions & 0 deletions examples/yaml/intents/AskTime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: AskTime
description: Intent to ask what the time is
version: 1
sampleUtterances:
- 'Whats the time'
- 'What time is it'
- 'Time please'
fulfillmentActivity:
codeHook:
uri: arn:aws:lambda:ap-southeast-2:293499315857:function:LexLambdaSampleFulfilment
messageVersion: "1.0"
type: CodeHook
Loading