<commit_before># Risu
Risu is an build tool for docker image with original cache mechanism.

![](https://cloud.githubusercontent.com/assets/261700/9082260/c51e910c-3b9d-11e5-9202-f0ab05207ac6.png)

## Quick start
First, run risu server as docker container.

```bash
$ docker run \
    --name risu \
    -e GITHUB_ACCESS_TOKEN=<KEY> \
    -p 8080:8080 \
    -v /var/run/docker.sock:/var/run/docker.sock \
    quay.io/wantedly/risu:latest
```

Second, trigger a new build via risu API.

```bash
$ curl -n -X POST https://<your-risu-server>.com/builds \
  -H "Content-Type: application/json" \
 \
  -d '{
  "source_repo": "wantedly/risu",
  "source_branch": "master",
  "image_name": "quay.io/wantedly/risu:latest",
  "dockerfile": "Dockerfile.dev",
  "cache_directories": [
    {
      "source": "vendor/bundle",
      "container": "/app/vendor/bundle"
    },
    {
      "source": "vendor/assets",
      "container": "/app/vendor/assets"
    }
  ]
}'
```

Then, risu server build docker image with original cache mechanism and push it to docker registry.

That's it!

## Documentation
### HTTP API

* [Build](https://github.com/wantedly/risu/blob/master/docs/api-v1-alpha.md#build)
 * [Create](https://github.com/wantedly/risu/blob/master/docs/api-v1-alpha.md#build-create)
 * [Info](https://github.com/wantedly/risu/blob/master/docs/api-v1-alpha.md#build-info)
 * [List](https://github.com/wantedly/risu/blob/master/docs/api-v1-alpha.md#build-list)

## Requirements

* `GITHUB_ACCESS_TOKEN`

## How it works
TBD

## Registry Backend
### localfs Backend Registry

```bash
$ docker run \
    --name risu \
    -e GITHUB_ACCESS_TOKEN=<KEY> \
    -p 8080:8080 \
    -v /var/run/docker.sock:/var/run/docker.sock \
    quay.io/wantedly/risu:latest
```

### etcd Backend Registry

```bash
$ docker run \
    --name risu \
    -e GITHUB_ACCESS_TOKEN=<KEY> \
    -e REGISTRY_BACKEND=etcd \
    -e REGISTRY_ENDPOINT=http://172.17.8.101:4001 \
    -p 8080:8080 \
    -v /var/run/docker.sock:/var/run/docker.sock \
    quay.io/wantedly/risu:latest
```

## Cache Backend
### localfs
TBD

### S3
TBD


## Contribution

1. Fork it ( http://github.com/koudaiii/risu )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create new Pull Request
<commit_msg>Fix repositoryu url<commit_after># Risu
Risu is an build tool for docker image with original cache mechanism.

![](https://cloud.githubusercontent.com/assets/261700/9082260/c51e910c-3b9d-11e5-9202-f0ab05207ac6.png)

## Quick start
First, run risu server as docker container.

```bash
$ docker run \
    --name risu \
    -e GITHUB_ACCESS_TOKEN=<KEY> \
    -p 8080:8080 \
    -v /var/run/docker.sock:/var/run/docker.sock \
    quay.io/wantedly/risu:latest
```

Second, trigger a new build via risu API.

```bash
$ curl -n -X POST https://<your-risu-server>.com/builds \
  -H "Content-Type: application/json" \
 \
  -d '{
  "source_repo": "wantedly/risu",
  "source_branch": "master",
  "image_name": "quay.io/wantedly/risu:latest",
  "dockerfile": "Dockerfile.dev",
  "cache_directories": [
    {
      "source": "vendor/bundle",
      "container": "/app/vendor/bundle"
    },
    {
      "source": "vendor/assets",
      "container": "/app/vendor/assets"
    }
  ]
}'
```

Then, risu server build docker image with original cache mechanism and push it to docker registry.

That's it!

## Documentation
### HTTP API

* [Build](https://github.com/wantedly/risu/blob/master/docs/api-v1-alpha.md#build)
 * [Create](https://github.com/wantedly/risu/blob/master/docs/api-v1-alpha.md#build-create)
 * [Info](https://github.com/wantedly/risu/blob/master/docs/api-v1-alpha.md#build-info)
 * [List](https://github.com/wantedly/risu/blob/master/docs/api-v1-alpha.md#build-list)

## Requirements

* `GITHUB_ACCESS_TOKEN`

## How it works
TBD

## Registry Backend
### localfs Backend Registry

```bash
$ docker run \
    --name risu \
    -e GITHUB_ACCESS_TOKEN=<KEY> \
    -p 8080:8080 \
    -v /var/run/docker.sock:/var/run/docker.sock \
    quay.io/wantedly/risu:latest
```

### etcd Backend Registry

```bash
$ docker run \
    --name risu \
    -e GITHUB_ACCESS_TOKEN=<KEY> \
    -e REGISTRY_BACKEND=etcd \
    -e REGISTRY_ENDPOINT=http://172.17.8.101:4001 \
    -p 8080:8080 \
    -v /var/run/docker.sock:/var/run/docker.sock \
    quay.io/wantedly/risu:latest
```

## Cache Backend
### localfs
TBD

### S3
TBD


## Contribution

1. Fork it ( http://github.com/wantedly/risu )
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Add some feature')
4. Push to the branch (git push origin my-new-feature)
5. Create new Pull Request

{'fraction_non_alphanumeric': 0.16322226908477436, 'fraction_numerical': 0.034162800506115566, 'mean_word_length': 3.1496062992125986, 'pattern_counts': {'":': 18, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6451121', 'n_tokens_mistral': 1967, 'n_tokens_neox': 1787, 'n_words': 366}