feat(ci): additional code/deps/security checks (#37)
To improve `CI` quality the following checks were added: * compile warnings * deprecated dependencies * insecure dependencies * unused dependencies * code vulnerabilities Also, to improve `CI` execution time, dependencies checks and lining were separated from the test pipeline. Last, but not least, to make local development easier a `Dockerfile` was created to contain any system dependencies, and targets to handle database creation and migration were added. Reviewed-on: #37
This commit is contained in:
@@ -13,17 +13,20 @@ services:
|
||||
- 'db_data:/var/lib/postgresql/data'
|
||||
restart: unless-stopped
|
||||
app:
|
||||
image: 'elixir:1.15.7-slim'
|
||||
image: &app_image 'joaodubas/ex_trainer:${EX_TRAINER_TAG:-dev}'
|
||||
build:
|
||||
target: builder
|
||||
context: .
|
||||
hostname: app
|
||||
depends_on:
|
||||
- db
|
||||
init: true
|
||||
environment:
|
||||
environment: &app_environment
|
||||
POSTGRES_HOST: *db_host
|
||||
POSTGRES_USER: *db_user
|
||||
POSTGRES_PASS: *db_pass
|
||||
POSTGRES_NAME: wabanex_dev
|
||||
volumes:
|
||||
volumes: &app_volumes
|
||||
- '.:/opt/app'
|
||||
- 'app_build:/opt/app/_build'
|
||||
- 'app_deps:/opt/app/deps'
|
||||
@@ -31,6 +34,30 @@ services:
|
||||
restart: unless-stopped
|
||||
entrypoint: sleep
|
||||
command: infinity
|
||||
db_setup:
|
||||
image: *app_image
|
||||
depends_on:
|
||||
- db
|
||||
profiles:
|
||||
- setup
|
||||
environment: *app_environment
|
||||
volumes: *app_volumes
|
||||
restart: 'no'
|
||||
command: |
|
||||
mix ecto.setup \
|
||||
&& MIX_ENV=test mix ecto.setup
|
||||
db_migrate:
|
||||
image: *app_image
|
||||
depends_on:
|
||||
- db
|
||||
profiles:
|
||||
- migrate
|
||||
environment: *app_environment
|
||||
volumes: *app_volumes
|
||||
restart: 'no'
|
||||
command: |
|
||||
mix ecto.migrate \
|
||||
&& MIX_ENV=test mix.ecto.migrate
|
||||
|
||||
volumes:
|
||||
db_data: {}
|
||||
|
Reference in New Issue
Block a user