Skip to content

Instantly share code, notes, and snippets.

@dopatraman
Created November 23, 2019 00:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dopatraman/14830beaef0e084c4c085a13d75bcbc7 to your computer and use it in GitHub Desktop.
Save dopatraman/14830beaef0e084c4c085a13d75bcbc7 to your computer and use it in GitHub Desktop.
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