Skip to content

Commit

Permalink
Clarify use of available install instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
sorentwo committed Jan 17, 2025
1 parent 62b87db commit aff8c58
Showing 1 changed file with 32 additions and 23 deletions.
55 changes: 32 additions & 23 deletions guides/introduction/installation.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
# Installation

Oban may be installed and configured via [igniter](https://hex.pm/packages/igniter) with a single command:
Before starting ensure your application has Ecto configured to use [Postgrex][postgrex] for
Postgres, [EctoSQLite3][ecto_sqlite3] for SQLite3, or [MyXQL][myxql] for use with MySQL.

```bash
mix igniter.install oban
```

That will add the latest version of `oban` to your dependencies before running the installer.
Installation will use the application's default Ecto repo, select the corresponding engine, and
set the pubsub notifier accordingly.
There are three installation mechanisms available:

Use the `--repo` flag to specify an alternate repo manually:

```bash
mix igniter.install oban --repo MyApp.LiteRepo
```
* [Semi-Automatic Installation](#semi-automatic-installation) using an igniter powered mix task
* [Igniter Installation](#igniter-installation) fully automatic installation using igniter
* [Manual Installation](#manual-installation) add oban and handle all steps manually

## Semi-Automatic Installation

It's possible to use the `oban.install` task without `igniter` available. First, add `oban` to
your deps in `mix.exs`:
It's possible to use the `oban.install` task without the `igniter.install` escript available.
First, add `oban` and `igniter` to your deps in `mix.exs`:

```elixir
{:igniter, "~> 0.5"},
{:oban, "~> 2.19"}
```

Expand All @@ -33,21 +27,35 @@ mix oban.install

That will automate all of the manual steps listed below!

## Igniter Installation

For projects that have [igniter][igniter] available, Oban may be installed and configured with a
single command:

```bash
mix igniter.install oban
```

That will add the latest version of `oban` to your dependencies before running the installer.
Installation will use the application's default Ecto repo, select the corresponding engine, and
set the pubsub notifier accordingly.

Use the `--repo` flag to specify an alternate repo manually:

```bash
mix igniter.install oban --repo MyApp.LiteRepo
```

## Manual Installation

Oban is published on [Hex](https://hex.pm/packages/oban). Add it to your list of deps in
`mix.exs`:
Add `:oban` to your list of deps in `mix.exs`:

```elixir
{:oban, "~> 2.19"}
```

You'll optionally need to include [Postgrex][postgrex] for Postgres, [EctoSQLite3][ecto_sqlite3]
for SQLite3, or [MyXQL][myxql] for use with MySQL. Then run `mix deps.get` to install Oban and its
dependencies.

After the packages are installed you must create a database migration to add the `oban_jobs` table
to your database:
Then run `mix deps.get` to install Oban and its dependencies. After the packages are installed you
must create a database migration to add the `oban_jobs` table to your database:

```bash
mix ecto.gen.migration add_oban_jobs_table
Expand Down Expand Up @@ -161,6 +169,7 @@ Oban.

[use]: Oban.html#Usage
[web]: https://github.com/oban-bg/oban_web
[igniter]: https://hex.pm/packages/igniter
[test]: testing.md
[postgrex]: https://hex.pm/packages/postgrex
[ecto_sqlite3]: https://hex.pm/packages/ecto_sqlite3
Expand Down

0 comments on commit aff8c58

Please sign in to comment.