# Rsync Deployment script

![npm](https://img.shields.io/npm/v/@korodrogerie/rsync-deployment)
![node-current (scoped)](https://img.shields.io/node/v/@korodrogerie/rsync-deployment)
![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)

## Usage

The CLI script is meant to be run using `npx`:

```bash
npx @korodrogerie/rsync-deployment .
```

The script is taking one option which is the path which should be deployed.

Additionally you can enable debugging output of the script using the flag `-vvv` similar to Symfony's console application.

```bash
npx @korodrogerie/rsync-deployment . -vvv
```

Additionally to the debug parameter `-vvv` you can enable debug output using the env variable `DEBUG=*` too. It uses the NPM package [debug](https://www.npmjs.com/package/debug) which gives you additional output.

## Further information

The script is doing two things. It uses [rsync](https://linux.die.net/man/1/rsync) to sync the latest changes files to the different app nodes. Additionally it clears the cache of the app node after the sync is done.

To clear the cache we're renaming the `cache` directory first, delete it and create a new `cache` directory.

## License

Licensed under MIT

Copyright (c) 2020-present [Koro Handels GmbH](https://github.com/KoRoHandelsGmbH/)