Skip to content

Instantly share code, notes, and snippets.

@dopatraman
Created Nov 23, 2019
Embed
What would you like to do?
cross-platform-releases-02-build-script
#!/usr/bin/env bash
set -e
echo "Starting release process..."
cd /opt/build # [1]
echo "Creating release artifact directory..."
mkdir -p /opt/build/rel/artifacts # [2]
echo "Installing rebar and hex..."
mix local.rebar --force # [3]
mix local.hex --if-missing --force
echo "Fetching project deps..."
mix deps.get
echo "Cleaning and compiling..."
echo "If you are using Phoenix, here is where you would run mix phx.digest"
mix phx.digest
echo "Generating release..."
mix release # [4]
echo "Creating tarball..."
tar -zcf "/opt/build/rel/artifacts/PROJECT_NAME-PROJECT_VERSION.tar.gz" /opt/build/_build/prod # [5]
echo "Release generated at rel/artifacts/PROJECT_NAME-PROJECT_VERSION.tar.gz"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment