Skip to content

Commit

Permalink
add example for installing with plugin command
Browse files Browse the repository at this point in the history
  • Loading branch information
claygregory committed Oct 27, 2017
1 parent be582bc commit 17e0099
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,26 @@ Following deployment, the Serverless Framework does not purge previous versions

## Installation

Install to project via npm:
```
Install with **npm**:
```sh
npm install --save-dev serverless-prune-plugin
```

Add the plugin to your `serverless.yml` file:
And then add the plugin to your `serverless.yml` file:
```yaml
plugins:
- serverless-prune-plugin
```
Alternatively, install with the Serverless **plugin command** (Serverless Framework 1.22 or higher):
```sh
sls plugin install -n serverless-prune-plugin
```

## Usage

In the project root, run:
```
```sh
sls prune -n <number of version to keep>
```

Expand All @@ -32,14 +37,14 @@ This will delete all but the `n`-most recent versions of each function deployed.
### Single Function

A single function can be targeted for cleanup:
```
```sh
sls prune -n <number of version to keep> -f helloWorld
```

### Region/Stage

The previous usage examples prune the default stage in the default region. Use `--stage` and `--region` to specify:
```
```sh
sls prune -n <number of version to keep> --stage production --region eu-central-1
```

Expand All @@ -60,14 +65,14 @@ To run automatically, the `automatic` property of `prune` must be set to `true`
### Dry Run

A dry-run will preview the deletion candidates, without actually performing the pruning operations:
```
```sh
sls prune -n <number of version to keep> --dryRun
```

### Additional Help

See:
```
```sh
sls prune --help
```

Expand Down

0 comments on commit 17e0099

Please sign in to comment.