Add config for SemaphoreCI
This commit is contained in:
parent
2de4eba30a
commit
0850850cd8
|
@ -0,0 +1,45 @@
|
|||
version: "v1.0"
|
||||
name: "CI Build"
|
||||
|
||||
agent:
|
||||
machine:
|
||||
type: e1-standard-2
|
||||
os_image: ubuntu1804
|
||||
|
||||
auto_cancel:
|
||||
running:
|
||||
when: "true"
|
||||
|
||||
fail_fast:
|
||||
stop:
|
||||
when: "true"
|
||||
|
||||
blocks:
|
||||
- name: "Build"
|
||||
dependencies: []
|
||||
task:
|
||||
env_vars:
|
||||
- name: MIX_ENV
|
||||
value: test
|
||||
- name: DATABASE_URL
|
||||
value: postgresql://postgres@localhost/test?encoding=utf8
|
||||
secrets:
|
||||
- name: elasticsearch-elixir-coveralls
|
||||
jobs:
|
||||
- name: "Build"
|
||||
matrix:
|
||||
- env_var: ELIXIR_VERSION
|
||||
values: ["1.11.3"]
|
||||
- env_var: ELASTICSEARCH_VERSION
|
||||
values: ["6.8.13"]
|
||||
commands:
|
||||
- sem-version elixir $ELIXIR_VERSION
|
||||
- sem-service start postgres
|
||||
- sem-service start elasticsearch $ELASTICSEARCH_VERSION
|
||||
- checkout
|
||||
- cache restore
|
||||
- mix local.hex --force
|
||||
- mix local.rebar --force
|
||||
- mix deps.get
|
||||
- bin/test
|
||||
- cache store
|
2
bin/test
2
bin/test
|
@ -10,7 +10,7 @@ MIX_ENV=test mix compile --warnings-as-errors --force || { echo 'Please fix all
|
|||
MIX_ENV=test mix docs || { echo 'Elixir HTML docs were not generated!'; exit 1; }
|
||||
|
||||
if [ $CI ]; then
|
||||
mix coveralls.travis || { echo 'Elixir tests failed!'; exit 1; }
|
||||
mix coveralls.semaphore || { echo 'Elixir tests failed!'; exit 1; }
|
||||
else
|
||||
mix test || { echo 'Elixir tests failed!'; exit 1; }
|
||||
fi
|
|
@ -7,7 +7,7 @@ config :elasticsearch, Elasticsearch.Test.Repo,
|
|||
username: "postgres",
|
||||
password: "",
|
||||
database: "elasticsearch_test",
|
||||
hostname: "db",
|
||||
hostname: System.get_env("DATABASE_HOST", "localhost"),
|
||||
pool: Ecto.Adapters.SQL.Sandbox,
|
||||
priv: "test/support/"
|
||||
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
# This file is responsible for configuring your application
|
||||
# and its dependencies with the aid of the Mix.Config module.
|
||||
use Mix.Config
|
||||
|
||||
config :elasticsearch, Elasticsearch.Test.Repo,
|
||||
adapter: Ecto.Adapters.Postgres,
|
||||
username: "postgres",
|
||||
password: "",
|
||||
database: "elasticsearch_test",
|
||||
hostname: "localhost",
|
||||
pool: Ecto.Adapters.SQL.Sandbox,
|
||||
priv: "test/support/"
|
||||
|
||||
config :elasticsearch, ecto_repos: [Elasticsearch.Test.Repo]
|
||||
|
||||
config :logger, level: :debug
|
|
@ -49,7 +49,7 @@ defmodule Elasticsearch.Index.Bulk do
|
|||
\"\"\"
|
||||
|
||||
iex> Bulk.encode!(Cluster, 123, "my-index")
|
||||
** (Protocol.UndefinedError) protocol Elasticsearch.Document not implemented for 123 of type Integer. This protocol is implemented for the following type(s): Post, Comment
|
||||
** (Protocol.UndefinedError) protocol Elasticsearch.Document not implemented for 123 of type Integer
|
||||
"""
|
||||
def encode!(cluster, struct, index) do
|
||||
config = Cluster.Config.get(cluster)
|
||||
|
|
Loading…
Reference in New Issue