Skip to content

Commit

Permalink
Merge pull request #25 from esl/uptdate-docs
Browse files Browse the repository at this point in the history
[ci skip][docs] remove old code from docs
  • Loading branch information
sescobb27 authored Jan 9, 2019
2 parents 705752f + 8a305e7 commit c0123d2
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 66 deletions.
96 changes: 44 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,54 +43,29 @@ $> docker container rm roger_rabbit
```ex
# Repo Poller Config

config :repo_poller, :repos, [
{
# repo to poll
"https://github.com/erlang/otp",
# how to poll that repo (we only support github for now)
RepoPoller.Repository.Github,
# poll interval in seconds
3600,
# tasks
[
[
# task to fetch
url: "https://github.com/emqtt/emqttd",
# commands or targets to execute secuentially
commands: ["app", "rel"],
# how to fetch the task
source: Domain.Tasks.Sources.Github,
# how to build, execute the task
runner: Domain.Tasks.Runners.Make,
# {Key, Value} tuples to pass as ENV to make please refer to [System.cmd/3](https://hexdocs.pm/elixir/System.html#cmd/3)
env: []
]
]
}
]

config :repo_poller, :github_auth, GITHUB_TOKEN # default System.get_env("GITHUB_AUTH")

# RabbitMQ Connection Config

# Optional, just QUEUE_NAME is required either in config or in ENV
config :repo_poller, :rabbitmq_config,
host: "localhost",
port: 5672,
channels: 1000,
host: "localhost", # optional
port: 5672, # optional
channels: 1000, # optional
queue: QUEUE_NAME, # required
exchange: "",
reconnect: 1000,
password: "guest",
username: "guest"
exchange: "", # optional
reconnect: 1000, # optional
password: "guest", # optional
username: "guest" # optional

# RabbitMQ Connection Pool Config

config :repo_poller, :rabbitmq_conn_pool,
pool_id: POOL_NAME, # required
name: {:local, POOL_NAME}, # required
worker_module: BugsBunny.Worker.RabbitConnection,
size: 2,
max_overflow: 0
pool_id: POOL_NAME, # required
name: {:local, POOL_NAME}, # required
worker_module: BugsBunny.Worker.RabbitConnection, # required
size: 2, # required
max_overflow: 0 # required
```

# Repo Jobs
Expand All @@ -104,24 +79,32 @@ config :repo_jobs, :consumers, NUMBER_OF_CONSUMERS # required

# RabbitMQ Connection Config

# Optional, just QUEUE_NAME is required either in config or in ENV
config :repo_jobs, :rabbitmq_config,
host: "localhost",
port: 5672,
channels: 1000,
host: "localhost", # optional
port: 5672, # optional
channels: 1000, # optional
queue: QUEUE_NAME, # required
exchange: "",
reconnect: 1000,
password: "guest",
username: "guest"
exchange: "", # optional
reconnect: 1000, # optional
password: "guest", # optional
username: "guest" # optional

# RabbitMQ Connection Pool Config

config :repo_jobs, :rabbitmq_conn_pool,
pool_id: POOL_NAME, # required
name: {:local, POOL_NAME}, # required
worker_module: BugsBunny.Worker.RabbitConnection,
size: 2,
max_overflow: 0
pool_id: POOL_NAME, # required
name: {:local, POOL_NAME}, # required
worker_module: BugsBunny.Worker.RabbitConnection, # required
size: 2, # required
max_overflow: 0 # required
```

## Environment

```bash
# Use this ENV variable if not using `config :repo_*, :rabbitmq_config, [queue: NAME]`
export QUEUE_NAME="new_releases.queue"
```

## Setup releases
Expand All @@ -138,5 +121,14 @@ MIX_ENV=prod mix release --name=poller
_build/prod/rel/poller/bin/poller foreground
```

`iex --name [email protected] --cookie hola -S mix`
`iex --name [email protected] --cookie hola -S mix`
## Development

```bash
cd apps/repo_jobs
iex --name [email protected] --cookie hola -S mix
```

```bash
cd apps/repo_poller
iex --name [email protected] --cookie hola -S mix
```
14 changes: 0 additions & 14 deletions rel/config/pooler.config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,3 @@ config :repo_poller, :rabbitmq_config,
channels: 10,
queue: System.get_env("QUEUE_NAME"),
exchange: ""

config :repo_poller, :repos, [
{"https://github.com/elixir-lang/elixir", RepoPoller.Repository.Github, 60,
[
[
url: "https://github.com/sescobb27/elixir-docker-guide",
commands: ["docker-push"],
env: [
{"DOCKER_USERNAME", System.get_env("DOCKER_USERNAME")},
{"DOCKER_PASSWORD", System.get_env("DOCKER_PASSWORD")}
]
]
]}
]

0 comments on commit c0123d2

Please sign in to comment.