Переглянути джерело

Add a build.sh file to build project on the local machine

theenglishway (time) 4 роки тому
батько
коміт
7043c93a99
1 змінених файлів з 25 додано та 0 видалено
  1. 25 0
      priv/build/build.sh

+ 25 - 0
priv/build/build.sh

@@ -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