feat: upgrade runtime and system dependencies (#5)
* Upgrade elixir, erlang, and postgres to their latest versions. * Fix CI configuration, so tests are executed. * Migrate project configuration from `Mix.Config` to `Config`. Reviewed-on: #5
This commit is contained in:
parent
410a509faa
commit
b7200555a8
16
.drone.yml
16
.drone.yml
@ -6,13 +6,21 @@ name: test
|
||||
trigger:
|
||||
event:
|
||||
include:
|
||||
- push
|
||||
- pull_request
|
||||
|
||||
steps:
|
||||
- name: database healthcheck
|
||||
image: 'postgres:14.2-alpine'
|
||||
environment:
|
||||
PGUSER: postgres
|
||||
PGPASSWORD: postgres
|
||||
PGHOST: db
|
||||
commands:
|
||||
- while ! pg_isready; do sleep 1; done
|
||||
- name: test
|
||||
image: 'elixir:1.21.1'
|
||||
environemnt:
|
||||
image: 'elixir:1.13.4'
|
||||
environment:
|
||||
MIX_ENV: test
|
||||
POSTGRES_HOST: db
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASS: postgres
|
||||
@ -22,7 +30,7 @@ steps:
|
||||
|
||||
services:
|
||||
- name: db
|
||||
image: 'postgres:13.3-alpine'
|
||||
image: 'postgres:14.2-alpine'
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
|
@ -1,2 +1,2 @@
|
||||
erlang 24.0.2
|
||||
elixir 1.12.1-otp-24
|
||||
erlang 24.3.3
|
||||
elixir 1.13.4-otp-24
|
||||
|
@ -5,7 +5,7 @@
|
||||
# is restricted to this project.
|
||||
|
||||
# General application configuration
|
||||
use Mix.Config
|
||||
import Config
|
||||
|
||||
config :wabanex,
|
||||
ecto_repos: [Wabanex.Repo]
|
||||
@ -32,4 +32,4 @@ config :phoenix, :json_library, Jason
|
||||
|
||||
# Import environment specific config. This must remain at the bottom
|
||||
# of this file so it overrides the configuration defined above.
|
||||
import_config "#{Mix.env()}.exs"
|
||||
import_config "#{config_env()}.exs"
|
||||
|
@ -1,11 +1,8 @@
|
||||
use Mix.Config
|
||||
import Config
|
||||
|
||||
# Configure your database
|
||||
config :wabanex, Wabanex.Repo,
|
||||
username: System.get_env("POSTGRES_USER") || "postgres",
|
||||
password: System.get_env("POSTGRES_PASS") || "postgres",
|
||||
database: "wabanex_dev",
|
||||
hostname: System.get_env("POSTGRES_HOST") || "localhost",
|
||||
show_sensitive_data_on_connection_error: true,
|
||||
pool_size: 10
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
use Mix.Config
|
||||
import Config
|
||||
|
||||
# For production, don't forget to configure the url host
|
||||
# to something meaningful, Phoenix uses this information
|
||||
|
6
config/runtime.exs
Normal file
6
config/runtime.exs
Normal file
@ -0,0 +1,6 @@
|
||||
import Config
|
||||
|
||||
config :wabanex, Wabanex.Repo,
|
||||
username: System.get_env("POSTGRES_USER") || "postgres",
|
||||
password: System.get_env("POSTGRES_PASS") || "postgres",
|
||||
hostname: System.get_env("POSTGRES_HOST") || "localhost"
|
@ -1,4 +1,4 @@
|
||||
use Mix.Config
|
||||
import Config
|
||||
|
||||
# Configure your database
|
||||
#
|
||||
@ -6,10 +6,7 @@ use Mix.Config
|
||||
# to provide built-in test partitioning in CI environment.
|
||||
# Run `mix help test` for more information.
|
||||
config :wabanex, Wabanex.Repo,
|
||||
username: System.get_env("POSTGRES_USER") || "postgres",
|
||||
password: System.get_env("POSTGRES_PASS") || "postgres",
|
||||
database: "wabanex_test#{System.get_env("MIX_TEST_PARTITION")}",
|
||||
hostname: System.get_env("POSTGRES_HOST") || "localhost",
|
||||
pool: Ecto.Adapters.SQL.Sandbox
|
||||
|
||||
# We don't run a server during test. If one is required,
|
||||
|
@ -2,7 +2,7 @@
|
||||
version: '3.7'
|
||||
services:
|
||||
db:
|
||||
image: 'postgres:13.3-alpine'
|
||||
image: 'postgres:14.2-alpine'
|
||||
hostname: &db_host db
|
||||
environment:
|
||||
POSTGRES_USER: &db_user postgres
|
||||
@ -12,5 +12,40 @@ services:
|
||||
- './priv/docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql'
|
||||
- 'db_data:/var/lib/postgresql/data'
|
||||
restart: unless-stopped
|
||||
app:
|
||||
image: 'elixir:1.13.4'
|
||||
hostname: app
|
||||
depends_on:
|
||||
- db
|
||||
init: true
|
||||
environment:
|
||||
POSTGRES_HOST: *db_host
|
||||
POSTGRES_USER: *db_user
|
||||
POSTGRES_PASS: *db_pass
|
||||
POSTGRES_NAME: wabanex_dev
|
||||
volumes:
|
||||
- '.:/opt/app'
|
||||
- 'app_build:/opt/app/_build'
|
||||
- 'app_deps:/opt/app/deps'
|
||||
working_dir: /opt/app
|
||||
entrypoint: sleep
|
||||
command: infinity
|
||||
pgcli:
|
||||
image: 'joaodubas/pgcli:latest'
|
||||
hostname: development
|
||||
depends_on:
|
||||
- db
|
||||
environment:
|
||||
PGUSER: *db_user
|
||||
PGPASSWORD: *db_pass
|
||||
PGHOST: *db_host
|
||||
PGDATABASE: wabanex_dev
|
||||
volumes:
|
||||
- './priv/docker/pgcli:/root/.config/pgcli'
|
||||
restart: unless-stopped
|
||||
entrypoint: sleep
|
||||
command: 3650d
|
||||
volumes:
|
||||
db_data: {}
|
||||
app_build: {}
|
||||
app_deps: {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user