Skip to content

Instantly share code, notes, and snippets.

@jonlunsford
Last active December 29, 2018 01:01
Show Gist options
  • Save jonlunsford/3bb0ec2c054519a333c12a7c568552d9 to your computer and use it in GitHub Desktop.
Save jonlunsford/3bb0ec2c054519a333c12a7c568552d9 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# place this file here:
# ./rel/bin/release
set -e
cd /opt/build
# Install updated versions of hex/rebar
mix local.rebar --force
mix local.hex --if-missing --force
# Compile our app with the prod env
export MIX_ENV=prod
# Fetch deps and compile
mix deps.get
# Run an explicit clean to remove any build artifacts from the host
mix do clean, compile --force
# Build the release
echo "Building release"
# $1 will be any args we need to pass to mix release
mix release $1
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment