https://github.com/serverless/serverless-meta-sync
Secure syncing of serverless project meta data across teams
https://github.com/serverless/serverless-meta-sync
Last synced: 8 months ago
JSON representation
Secure syncing of serverless project meta data across teams
- Host: GitHub
- URL: https://github.com/serverless/serverless-meta-sync
- Owner: serverless
- Created: 2016-03-23T03:51:58.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-13T04:36:31.000Z (over 9 years ago)
- Last Synced: 2025-04-12T15:04:15.903Z (9 months ago)
- Language: JavaScript
- Size: 16.6 KB
- Stars: 44
- Watchers: 30
- Forks: 14
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [Serverless](http://serverless.com/) Meta Sync Plugin
[](http://www.serverless.com)
[](https://gitter.im/serverless/serverless)
[](https://www.npmjs.com/package/serverless-meta-sync)
[](https://www.npmjs.com/package/serverless-meta-sync)
[](https://www.npmjs.com/package/serverless-meta-sync)
[](https://www.npmjs.com/package/serverless-meta-sync)
Secure syncing of Serverless project's meta data across teams (via S3 bucket).
This plugin adds a `serverless meta sync` command. When you run it with a stage or a region `-s dev -r us-east-1`, this plugin will first find or create an S3 bucket using the credentials you have set for that stage, then sync the variables files you have locally with the ones on the S3 bucket. For example, running `serverless meta sync -s dev` will sync your project's `s-variables-dev.json` with the `s-variables-dev.json` located on the S3 bucket.
When used via the CLI and conflicts are found, an interactive screen will let you easily select which option to use. When used without the CLI, the files located remotely automatically overwrite the files located locally, which is useful when used in the beginning of CI processes.
## Demo
[](https://asciinema.org/a/40566)
## Setup
* Install via npm in the root of your Serverless Project:
```
npm install serverless-meta-sync --save
```
* Add the plugin to the `plugins` array and to the `custom` object in your Serverless Project's `s-project.json`, like this:
```js
"custom": {
"meta": {
"name": "YOUR_SYNC_S3_BUCKET_NAME",
"region": "S3_BUCKET_REGION",
// Optional, by default: "serverless/PROJECT_NAME/variables/"
"keyPrefix": "S3_KEY_PREFIX"
}
},
"plugins": [
"serverless-meta-sync"
]
```
* All done!
## Usage
Run: `serverless meta sync`.
### Options
* `-s` `--stage` — Stage. Optional if only one stage is defined in project. This will only sync the variables file of the specified stage (e.g., `s-variables-dev.json`).
* `-r` `--region` — Region. Optional. This will only sync the variables file for the specified region in the specified stage (e.g., `s-variables-dev-useast1.json`).