|
|
@@ -0,0 +1,25 @@
|
|
|
+#!/bin/bash
|
|
|
+# Build a project for production in the form of a release
|
|
|
+
|
|
|
+set -euo pipefail
|
|
|
+
|
|
|
+MIX_ENV=${MIX_ENV-prod}
|
|
|
+
|
|
|
+export MIX_ENV=$MIX_ENV
|
|
|
+
|
|
|
+# Run an explicit clean beforehand
|
|
|
+mix clean --only $MIX_ENV
|
|
|
+
|
|
|
+# Fetch deps and compile
|
|
|
+mix deps.get --only $MIX_ENV
|
|
|
+
|
|
|
+# Compile
|
|
|
+mix compile --force
|
|
|
+
|
|
|
+# Prepare the release
|
|
|
+mix release --overwrite
|
|
|
+
|
|
|
+# Build static assets
|
|
|
+npm --prefix ./assets ci --progress=false --no-audit --loglevel=error
|
|
|
+npm run --prefix ./assets deploy
|
|
|
+mix phx.digest
|