forked from toolshed/docs.coopcloud.tech
Add Restarting an App refactor style abra/cheet-sheet.md
This commit is contained in:
parent
ff39cf10b6
commit
36e18bdc62
@ -12,7 +12,8 @@ title: Cheat sheet
|
|||||||
|
|
||||||
`abra autocomplete bash/zsh/fizsh`
|
`abra autocomplete bash/zsh/fizsh`
|
||||||
|
|
||||||
### create and deploy a new app:
|
### Create & deploy a new app:
|
||||||
|
|
||||||
- `abra app new $RECIPE`
|
- `abra app new $RECIPE`
|
||||||
flags: `-s/--server`, `-D/--domain`, `-S/--secrets`, `-p/--pass`
|
flags: `-s/--server`, `-D/--domain`, `-S/--secrets`, `-p/--pass`
|
||||||
- `abra app config $APPNAME`
|
- `abra app config $APPNAME`
|
||||||
@ -21,43 +22,88 @@ flags: `-p/--pass`, `-a/--all`
|
|||||||
- `abra app deploy $APPNAME`
|
- `abra app deploy $APPNAME`
|
||||||
flags: `-f/--force`, `-C/--chaos`
|
flags: `-f/--force`, `-C/--chaos`
|
||||||
|
|
||||||
### undeploy and remove an app
|
|
||||||
- back up any data you don't want to lose
|
|
||||||
- `abra app undeploy $APPNAME`
|
|
||||||
- `abra app rm --volumes $APPNAME`
|
|
||||||
flags: `-f/--force`, `-V/--volumes`
|
|
||||||
|
|
||||||
### upgrade abra
|
### Restarting an app
|
||||||
- `abra upgrade`
|
|
||||||
flags: `--rc`
|
|
||||||
|
|
||||||
### upgrade a recipe
|
To run `restart` you need to specify the `<service>` name with the default being `app`
|
||||||
- `abra recipe upgrade $RECIPE`
|
|
||||||
flags: `-x,y,z/--major,minor,patch`
|
```
|
||||||
- `abra recipe sync $RECIPE`
|
$ abra app restart <domain> app
|
||||||
flags: `-x,y,z`
|
```
|
||||||
- `abra recipe release $RECIPE [$VERSION]`
|
|
||||||
flags: `-p/--publish`, `-r/--dry-run`, `-x,y,z`
|
### Undeploy & remove an app
|
||||||
|
|
||||||
|
Back up any data you don't want to lose
|
||||||
|
|
||||||
|
```
|
||||||
|
$ abra app undeploy $APPNAME
|
||||||
|
$ abra app rm --volumes $APPNAME
|
||||||
|
```
|
||||||
|
|
||||||
|
Optional flags: `-f/--force`, `-V/--volumes`
|
||||||
|
|
||||||
|
|
||||||
|
### Upgrade abra
|
||||||
|
|
||||||
|
To upgrade `abra` itself, run the following:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ abra upgrade
|
||||||
|
```
|
||||||
|
|
||||||
|
Option flags: `--rc`
|
||||||
|
|
||||||
|
|
||||||
|
### Upgrade a recipe
|
||||||
|
|
||||||
|
```
|
||||||
|
$ abra recipe upgrade $RECIPE`
|
||||||
|
```
|
||||||
|
|
||||||
|
Option flags: `-x,y,z/--major,minor,patch`
|
||||||
|
|
||||||
|
```
|
||||||
|
$ abra recipe sync $RECIPE
|
||||||
|
```
|
||||||
|
|
||||||
|
Optional flags: `-x,y,z`
|
||||||
|
|
||||||
|
```
|
||||||
|
$ abra recipe release $RECIPE [$VERSION]
|
||||||
|
```
|
||||||
|
|
||||||
|
Optional flags: `-p/--publish`, `-r/--dry-run`, `-x,y,z`
|
||||||
|
|
||||||
|
|
||||||
|
### Make changes to a recipe
|
||||||
|
|
||||||
|
Edit the files in `~/.abra/recipe/$RECIPENAME`
|
||||||
|
|
||||||
|
Deploy the changed version to your test instance
|
||||||
|
|
||||||
|
Determine how serious your change is (semver.org for reference)
|
||||||
|
|
||||||
|
```
|
||||||
|
$ abra recipe release $RECIPE [$VERSION]
|
||||||
|
```
|
||||||
|
|
||||||
### make a change to a recipe
|
|
||||||
- edit the files in `~/.abra/recipe/$RECIPENAME`
|
|
||||||
- deploy the changed version to your test instance
|
|
||||||
- determine how serious your change is (semver.org for reference)
|
|
||||||
- `abra recipe release $RECIPE [$VERSION]`
|
|
||||||
|
|
||||||
### Advanced Listing using `jq`
|
### Advanced Listing using `jq`
|
||||||
|
|
||||||
Several `abra` commands can output JSON formatted tables, and can thus be queried and filtered with the tool [jq](https://stedolan.github.io/jq/ "jq JSON Query tool"). We can also format these outputs with [tv](https://github.com/uzimaru0000/tv "tv Table Viewer") into a pretty table.
|
Several `abra` commands can output JSON formatted tables, and can thus be queried and filtered with the tool [jq](https://stedolan.github.io/jq/ "jq JSON Query tool"). We can also format these outputs with [tv](https://github.com/uzimaru0000/tv "tv Table Viewer") into a pretty table.
|
||||||
|
|
||||||
|
|
||||||
Currently, `abra recipe ls`, `abra server ls`, and `abra app ls` support the `-m` machine readable output flag which outputs JSON.
|
Currently, `abra recipe ls`, `abra server ls`, and `abra app ls` support the `-m` machine readable output flag which outputs JSON.
|
||||||
|
|
||||||
|
|
||||||
#### Filter recipes by "category"
|
#### Filter recipes by "category"
|
||||||
|
|
||||||
`abra recipe ls -m | jq '[.[] | select(.category == "Utilities") ]' | tv`
|
```
|
||||||
|
$ abra recipe ls -m | jq '[.[] | select(.category == "Utilities") ]' | tv
|
||||||
|
```
|
||||||
|
|
||||||
As you can see we, we're selecting all recipes where category is "Utilities".
|
As you can see we, we're selecting all recipes where category is "Utilities".
|
||||||
|
|
||||||
|
|
||||||
#### Filter apps by state `deployed`
|
#### Filter apps by state `deployed`
|
||||||
|
|
||||||
!!! info
|
!!! info
|
||||||
@ -66,6 +112,8 @@ As you can see we, we're selecting all recipes where category is "Utilities".
|
|||||||
!!! info
|
!!! info
|
||||||
`abra app ls` lists apps grouped into a server object, with statistics about the server. In `jq` we can select the entire apps list with `.[].apps[]`.
|
`abra app ls` lists apps grouped into a server object, with statistics about the server. In `jq` we can select the entire apps list with `.[].apps[]`.
|
||||||
|
|
||||||
`abra app ls -m -S |jq '[.[].apps[] | select(.status == "deployed") | del(.upgrade)]' |tv`
|
```
|
||||||
|
$ abra app ls -m -S |jq '[.[].apps[] | select(.status == "deployed") | del(.upgrade)]' |tv
|
||||||
|
```
|
||||||
|
|
||||||
The `del(.upgrade)` filter filters out available versions for the recipe in question for that row. It could be useful to leave in if you want a list of deployed apps that need an upgrade.
|
The `del(.upgrade)` filter filters out available versions for the recipe in question for that row. It could be useful to leave in if you want a list of deployed apps that need an upgrade.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user