-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Formalize add/remove examples as bashbot commands
- Loading branch information
1 parent
166d573
commit 0c8c1a9
Showing
9 changed files
with
188 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Bashbot Example - Add Example Command | ||
|
||
In this example, a json example can be added to a running configuration json. | ||
|
||
***Note: This will not work when the configuration json is mounted as a configmap. Use the seed method if bashbot is deployed in kubernetes to use this example*** | ||
|
||
## Bashbot Configuration | ||
|
||
This command is triggered by sending `bashbot asdf` in a slack channel where Bashbot is also a member. There is no external script for this command, takes no arugments/parameters, and expects Bashbot's examples directory to exist. The valid arguments for this command come from the output of `bashbot list-examples` | ||
|
||
```json | ||
{ | ||
"name": "Add Example Command", | ||
"description": "Add command from Bashbot example commands", | ||
"help": "bashbot add-example", | ||
"trigger": "add-example", | ||
"location": "./examples", | ||
"command": ["./add-example/add-command.sh $(find . -name \"${add_command}.json\")"], | ||
"parameters": [ | ||
{ | ||
"name": "add_command", | ||
"allowed": [], | ||
"description": "a command to add to bashbot config ('bashbot list-examples')", | ||
"source": ["find . -name \"*.json\" | xargs -I {} basename {} .json"] | ||
} | ||
], | ||
"log": false, | ||
"ephemeral": false, | ||
"response": "code", | ||
"permissions": [ | ||
"all" | ||
] | ||
} | ||
``` |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "Add Example Command", | ||
"description": "Add command from Bashbot example commands", | ||
"help": "bashbot add-example", | ||
"trigger": "add-example", | ||
"location": "./examples", | ||
"command": ["./add-example/add-command.sh $(find . -name \"${add_command}.json\")"], | ||
"parameters": [ | ||
{ | ||
"name": "add_command", | ||
"allowed": [], | ||
"description": "a command to add to bashbot config ('bashbot list-examples')", | ||
"source": ["find . -name \"*.json\" | xargs -I {} basename {} .json"] | ||
} | ||
], | ||
"log": false, | ||
"ephemeral": false, | ||
"response": "code", | ||
"permissions": [ | ||
"all" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Bashbot Example - Add Example Command | ||
|
||
In this example, a json example can be added to a running configuration json. | ||
|
||
***Note: This will not work when the configuration json is mounted as a configmap. Use the seed method if bashbot is deployed in kubernetes to use this example*** | ||
|
||
## Bashbot Configuration | ||
|
||
This command is triggered by sending `bashbot asdf` in a slack channel where Bashbot is also a member. There is no external script for this command, takes no arugments/parameters, and expects Bashbot's examples directory to exist. This command takes no arguments. | ||
|
||
```json | ||
{ | ||
"name": "List Example Commands", | ||
"description": "List commands from bashbot example commands", | ||
"help": "bashbot list-examples", | ||
"trigger": "list-examples", | ||
"location": "./examples", | ||
"command": [ | ||
"find . -name \"*.json\" | xargs -I {} basename {} .json" | ||
], | ||
"parameters": [], | ||
"log": false, | ||
"ephemeral": false, | ||
"response": "code", | ||
"permissions": [ | ||
"all" | ||
] | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"name": "Add Example Command", | ||
"description": "Add command from Bashbot example commands", | ||
"help": "bashbot add-example", | ||
"trigger": "add-example", | ||
"location": "./examples", | ||
"command": ["./add-example/add-command.sh $(find . -name \"${add_command}.json\")"], | ||
"parameters": [ | ||
{ | ||
"name": "add_command", | ||
"allowed": [], | ||
"description": "a command to add to bashbot config ('bashbot list-examples')", | ||
"source": ["find . -name \"*.json\" | xargs -I {} basename {} .json"] | ||
} | ||
], | ||
"log": false, | ||
"ephemeral": false, | ||
"response": "code", | ||
"permissions": [ | ||
"all" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Bashbot Example - Remove Example Command | ||
|
||
In this example, a json example can be removed from a running configuration. | ||
|
||
***Note: This will not work when the configuration json is mounted as a configmap. Use the seed method if bashbot is deployed in kubernetes to use this example*** | ||
|
||
## Bashbot Configuration | ||
|
||
This command is triggered by sending `bashbot asdf` in a slack channel where Bashbot is also a member. There is no external script for this command, takes no arugments/parameters, and expects Bashbot's examples directory to exist. The valid arguments for this command come from the output of `bashbot list-examples` | ||
|
||
```json | ||
{ | ||
"name": "Remove Example Command", | ||
"description": "Remove command from bashbot example commands", | ||
"help": "bashbot remove-example", | ||
"trigger": "remove-example", | ||
"location": "./examples", | ||
"command": ["./remove-command.sh ${remove_command}" | ||
], | ||
"parameters": [ | ||
{ | ||
"name": "remove_command", | ||
"allowed": [], | ||
"description": "a command to remove to bashbot config ('bashbot list-examples')", | ||
"source": ["find . -name \"*.json\" | xargs -I {} basename {} .json"] | ||
} | ||
], | ||
"log": false, | ||
"ephemeral": false, | ||
"response": "code", | ||
"permissions": [ | ||
"all" | ||
] | ||
} | ||
``` |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "Remove Example Command", | ||
"description": "Remove command from bashbot example commands", | ||
"help": "bashbot remove-example", | ||
"trigger": "remove-example", | ||
"location": "./examples", | ||
"command": ["./remove-command.sh ${remove_command}" | ||
], | ||
"parameters": [ | ||
{ | ||
"name": "remove_command", | ||
"allowed": [], | ||
"description": "a command to remove to bashbot config ('bashbot list-examples')", | ||
"source": ["find . -name \"*.json\" | xargs -I {} basename {} .json"] | ||
} | ||
], | ||
"log": false, | ||
"ephemeral": false, | ||
"response": "code", | ||
"permissions": [ | ||
"all" | ||
] | ||
} |