From 5075a1bd9ba10d7fdcf25475090be00dad0aa210 Mon Sep 17 00:00:00 2001 From: shibao Date: Sun, 23 Jan 2022 00:36:35 -0500 Subject: [PATCH] add drone ci --- .drone.yml | 28 ++++++++++++++++++++++++++++ README.md | 5 +++++ config/test.exs | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 .drone.yml diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 00000000..64208f79 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,28 @@ +kind: pipeline +type: docker +name: cannery + +cache: + mount: + - _build + - deps + +steps: +- name: test + image: bitwalker/alpine-elixir-phoenix:1.13 + environment: + TEST_DATABASE_URL: ecto://postgres:postgres@database/cannery_test + commands: + - mix local.rebar --force + - mix local.hex --force + - mix deps.get + - npm install --prefix assets + - mix test + +services: +- name: database + image: postgres:13 + environment: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: postgres diff --git a/README.md b/README.md index 17b208e9..fac31d8e 100644 --- a/README.md +++ b/README.md @@ -56,3 +56,8 @@ In `prod` mode (or in the Docker container), Cannery will listen for these envir - `SECRET_KEY_BASE`: Secret key base used to sign cookies. Must be generated with `mix phx.gen.secret` and set for server to start. - `REGISTRATION`: Controls if user sign-up should be invite only or set to public. Set to `public` to enable public registration. Defaults to `invite`. + +--- + +[![Build +Status](https://drone.bubbletea.dev/api/badges/shibao/cannery/status.svg?ref=refs/heads/dev)](https://drone.bubbletea.dev/shibao/cannery) diff --git a/config/test.exs b/config/test.exs index 6ccf0dfc..1aea720a 100644 --- a/config/test.exs +++ b/config/test.exs @@ -10,7 +10,7 @@ config :bcrypt_elixir, :log_rounds, 1 # Run `mix help test` for more information. config :cannery, Cannery.Repo, url: - System.get_env("DATABASE_URL") || + System.get_env("TEST_DATABASE_URL") || "ecto://postgres:postgres@localhost/cannery_test#{System.get_env("MIX_TEST_PARTITION")}", pool: Ecto.Adapters.SQL.Sandbox, pool_size: 10