2021-04-16 04:35:17 +02:00
|
|
|
#!/usr/bin/env sh
|
2025-01-11 18:32:17 +01:00
|
|
|
set -e
|
2020-10-26 22:01:29 +01:00
|
|
|
|
|
|
|
export MIX_ENV=test
|
|
|
|
|
|
|
|
# Always install mix dependencies
|
|
|
|
(cd /srv/philomena && mix deps.get)
|
|
|
|
|
2025-01-11 18:32:17 +01:00
|
|
|
# Run formatting check
|
|
|
|
mix format --check-formatted
|
|
|
|
|
2024-05-25 20:03:45 +02:00
|
|
|
# Sleep to allow OpenSearch to finish initializing
|
2020-10-26 22:01:29 +01:00
|
|
|
# if it's not done doing whatever it does yet
|
2024-05-25 20:03:45 +02:00
|
|
|
echo -n "Waiting for OpenSearch"
|
2020-10-26 22:01:29 +01:00
|
|
|
|
2024-05-24 22:36:00 +02:00
|
|
|
until wget -qO - opensearch:9200; do
|
2020-10-26 22:01:29 +01:00
|
|
|
echo -n "."
|
|
|
|
sleep 2
|
|
|
|
done
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
# Create the database
|
|
|
|
mix ecto.create
|
|
|
|
mix ecto.load
|
|
|
|
|
|
|
|
# Test the application
|
2025-01-11 18:32:17 +01:00
|
|
|
mix test
|
|
|
|
|
|
|
|
# Security lint
|
|
|
|
mix sobelow --config
|
|
|
|
mix deps.audit
|
|
|
|
|
|
|
|
# Static analysis
|
|
|
|
exec mix dialyzer
|