Skip to content

Commit

Permalink
initial implementation (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
the-mikedavis authored Jun 11, 2021
1 parent f37d9ad commit c87a0d4
Show file tree
Hide file tree
Showing 28 changed files with 1,394 additions and 113 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,27 @@ env:
jobs:
bless:
name: Bless
runs-on: ubuntu-16.04
runs-on: ubuntu-latest
env:
MIX_ENV: test
EVENTSTORE_TCP_HOST: localhost
EVENTSTORE_GRPC_HOST: localhost

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Stand up docker-compose services
run: docker-compose up -d

- name: Determine the elixir version
run: echo "ELIXIR_VERSION=$(grep -h elixir .tool-versions | awk '{ print $2 }' | awk -F - '{print $1}')" >> $GITHUB_ENV

- name: Determine the otp version
run: echo "OTP_VERSION=$(grep -h erlang .tool-versions | awk '{ print $2 }')" >> $GITHUB_ENV

- name: Setup Elixir and Erlang versions
uses: actions/setup-elixir@v1
uses: erlef/setup-beam@v1
with:
elixir-version: ${{ env.ELIXIR_VERSION }}
otp-version: ${{ env.OTP_VERSION }}
Expand Down Expand Up @@ -51,6 +56,7 @@ jobs:
run: |
mix local.rebar --force
mix local.hex --force
mix hex.organization auth cuatro --key $CUATRO_HEX_KEY
mix deps.get
- name: Compile dependencies
Expand All @@ -71,7 +77,7 @@ jobs:

publish-hex-package:
name: Publish Hex Package ⬆️☁️
runs-on: ubuntu-16.04
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
env:
MIX_ENV: dev
Expand Down Expand Up @@ -117,6 +123,7 @@ jobs:
run: |
mix local.rebar --force
mix local.hex --force
mix hex.organization auth cuatro --key $CUATRO_HEX_KEY
mix deps.get
- name: Compile dependencies
Expand Down Expand Up @@ -149,7 +156,7 @@ jobs:
prerelease: false

- name: Publish library
run: mix hex.publish --yes
run: mix hex.publish --yes --organization cuatro
env:
HEX_API_KEY: ${{ secrets.HEX_PUBLISH_KEY }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/refresh-dev-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
jobs:
refresh-dev-cache:
name: Refresh Dev Cache
runs-on: ubuntu-16.04
runs-on: ubuntu-latest
env:
MIX_ENV: dev

Expand Down
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
elixir 1.10.3-otp-21
erlang 21.0
elixir 1.12.1-otp-24
erlang 24.0
4 changes: 3 additions & 1 deletion config/config.exs
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
use Mix.Config
import Config

import_config "#{Mix.env()}.exs"
1 change: 1 addition & 0 deletions config/dev.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import Config
1 change: 1 addition & 0 deletions config/prod.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import Config
18 changes: 18 additions & 0 deletions config/test.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import Config

config :beeline,
get_stream_position: fn _producer -> -1 end,
auto_subscribe?: fn _producer -> true end,
spawn_health_checkers?: true

config :beeline, Beeline.Fixtures.ExtremeClient,
db_type: :node,
host: System.get_env("EVENTSTORE_TCP_HOST") || "localhost",
port: 1113,
username: "admin",
password: "changeit",
max_attempts: :infinity,
reconnect_delay: 2_000

config :beeline, Beeline.Fixtures.SpearClient,
host: System.get_env("EVENTSTORE_GRPC_HOST") || "localhost"
3 changes: 3 additions & 0 deletions coveralls.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"minimum_coverage": 100,
"treat_no_relevant_lines_as_covered" : true
},
"terminal_options": {
"file_column_width": 60
},
"skip_files": [
"^test",
"^deps"
Expand Down
30 changes: 30 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: '3.8'

services:
eventstoredb20:
image: eventstore/eventstore:21.2.0-buster-slim
command: /opt/eventstore/eventstored --insecure --run-projections=All
ports:
- 2113:2113

eventstoredb5:
image: eventstore/eventstore:release-5.0.10
environment:
EVENTSTORE_START_STANDARD_PROJECTIONS: "True"
EVENTSTORE_RUN_PROJECTIONS: "All"
ports:
- 1113:1113

app:
image: elixir:1.12.1
depends_on:
- eventstoredb20
- eventstoredb5
environment:
- 'ERL_AFLAGS=-kernel shell_history enabled'
- EVENTSTORE_GRPC_HOST=eventstoredb20
- EVENTSTORE_TCP_HOST=eventstoredb5
volumes:
- ./:/app
working_dir: /app
command: tail -f /dev/null
Loading

0 comments on commit c87a0d4

Please sign in to comment.