<commit_before>Stretcher
=========

A deployment tool with [Consul](https://consul.io) / [Serf](https://www.serfdom.io/) event.

## Example manifest

```yml
src: s3://example.com/app.tar.gz
checksum: e0840daaa97cd2cf2175f9e5d133ffb3324a2b93
dest: /home/stretcher/app
commands:
  pre:
    - echo 'staring deploy'
  post:
    - echo 'deploy done'
  success:
    - echo 'deploy success'
  failure:
    - echo 'deploy failed!!'
    - cat >> /path/to/failure.log
excludes:
  - "*.pid"
  - "*.socket"
```

## Run

### stretcher agent

```
$ stretcher -h
Usage of stretcher:
  -max-bandwidth string
        max bandwidth for download src archives (Bytes/sec)
  -random-delay float
        sleep [0,random-delay) sec on start
  -retry int
        retry count for download src archives
  -retry-wait int
        wait for retry download src archives (sec) (default 3)
  -timeout int
        timeout for download src archives (sec)
  -v    show version
  -version
        show version
```

#### with Consul

A stretcher agent is designed as running under "consul watch" and will be kicked by [Consul](https://consul.io) event.

```
$ consul watch -type event -name deploy /path/to/stretcher
```

* `-name`: your deployment identity name.

#### with Serf

A stretcher agent can be running as [Serf](https://www.serfdom.io/) event handler.

```
$ serf agent -event-handler="user:deploy=/path/to/stretcher >> /path/to/stretcher.log 2>&1"
```

#### Load AWS credentials

When you specify a S3 URL in manifest, requires a AWS credential setting one of below.<commit_msg>add README.md<commit_after>Stretcher
=========

A deployment tool with [Consul](https://consul.io) / [Serf](https://www.serfdom.io/) event.

## Example manifest

```yml
src: s3://example.com/app.tar.gz
checksum: e0840daaa97cd2cf2175f9e5d133ffb3324a2b93
dest: /home/stretcher/app
commands:
  pre:
    - echo 'staring deploy'
  post:
    - echo 'deploy done'
  success:
    - echo 'deploy success'
  failure:
    - echo 'deploy failed!!'
    - cat >> /path/to/failure.log
excludes:
  - "*.pid"
  - "*.socket"
```

## Run

### stretcher agent

```
$ stretcher -h
Usage of stretcher:
  -max-bandwidth string
        max bandwidth for download src archives (Bytes/sec)
  -random-delay float
        sleep [0,random-delay) sec on start
  -retry int
        retry count for download src archives
  -retry-wait int
        wait for retry download src archives (sec) (default 3)
  -rsync-verbose string
        rsync verbose option (default -v)
  -timeout int
        timeout for download src archives (sec)
  -v    show version
  -version
        show version
```

#### with Consul

A stretcher agent is designed as running under "consul watch" and will be kicked by [Consul](https://consul.io) event.

```
$ consul watch -type event -name deploy /path/to/stretcher
```

* `-name`: your deployment identity name.

#### with Serf

A stretcher agent can be running as [Serf](https://www.serfdom.io/) event handler.

```
$ serf agent -event-handler="user:deploy=/path/to/stretcher >> /path/to/stretcher.log 2>&1"
```

#### Load AWS credentials

When you specify a S3 URL in manifest, requires a AWS credential setting one of below.
{'fraction_non_alphanumeric': 0.13169502205419029, 'fraction_numerical': 0.018273471959672338, 'mean_word_length': 3.118028534370947, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 8, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '586107', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1044, 'n_words': 333}