Skip to content

Commit

Permalink
Updated build tools to remove postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
kieraneglin committed Feb 16, 2024
1 parent 8068951 commit 5a46a6a
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 36 deletions.
3 changes: 0 additions & 3 deletions .env.sample

This file was deleted.

3 changes: 0 additions & 3 deletions .github/workflows/lint_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ jobs:
- name: Create and populate ENV file
run: |
echo MIX_ENV=test >> .env
echo POSTGRES_HOST=postgres >> .env
echo POSTGRES_USER=postgres >> .env
echo POSTGRES_PASSWORD=postgres >> .env
- name: Pull prebuilt images
run: docker compose pull
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM elixir:latest

# Install debian packages
RUN apt-get update -qq
RUN apt-get install -y inotify-tools postgresql-client ffmpeg \
RUN apt-get install -y inotify-tools ffmpeg \
python3 python3-pip python3-setuptools python3-wheel python3-dev

# Install nodejs
Expand Down
2 changes: 1 addition & 1 deletion config/dev.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ config :pinchflat,

# Configure your database
config :pinchflat, Pinchflat.Repo,
database: Path.expand("../pinchflat_dev.db", Path.dirname(__ENV__.file)),
database: Path.expand("../priv/repo/pinchflat_dev.db", Path.dirname(__ENV__.file)),
show_sensitive_data_on_connection_error: true,
pool_size: 5

Expand Down
2 changes: 1 addition & 1 deletion config/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ config :pinchflat, Oban, testing: :manual
# to provide built-in test partitioning in CI environment.
# Run `mix help test` for more information.
config :pinchflat, Pinchflat.Repo,
database: Path.expand("../pinchflat_test.db", Path.dirname(__ENV__.file)),
database: Path.expand("../priv/repo/pinchflat_test.db", Path.dirname(__ENV__.file)),
pool_size: 5,
pool: Ecto.Adapters.SQL.Sandbox

Expand Down
7 changes: 0 additions & 7 deletions docker-compose.ci.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
version: '3'
services:
postgres:
image: 'postgres:16-alpine'
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres

phx:
build: .
volumes:
- '.:/app'
ports:
- '4008:4008'
command: tail -F /dev/null
env_file: .env
10 changes: 0 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
version: '3'
services:
postgres:
image: 'postgres:16-alpine'
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres

phx:
build: .
volumes:
- '.:/app'
ports:
- '4008:4008'
depends_on:
- postgres
command:
- ./docker-run.sh
stdin_open: true
tty: true
env_file:
- .env
9 changes: 0 additions & 9 deletions docker-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,6 @@ echo "\nInstalling JS..."
cd assets && yarn install
cd ..

# Wait for Postgres to become available.
export PGPASSWORD=$(echo $POSTGRES_PASSWORD)
until psql -h postgres -U $POSTGRES_USER -c '\q' 2>/dev/null; do
echo >&2 "Postgres is unavailable - sleeping"
sleep 1
done

echo "\nPostgres is available: continuing with database setup..."

# Potentially Set up the database
mix ecto.create
mix ecto.migrate
Expand Down
1 change: 0 additions & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ defmodule Pinchflat.MixProject do
{:phoenix_ecto, "~> 4.4"},
{:ecto_sql, "~> 3.10"},
{:ecto_sqlite3, ">= 0.0.0"},
{:postgrex, ">= 0.0.0"},
{:phoenix_html, "~> 3.3"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:phoenix_live_view, "~> 0.20.1"},
Expand Down

0 comments on commit 5a46a6a

Please sign in to comment.