Created
November 23, 2019 00:14
-
-
Save dopatraman/14830beaef0e084c4c085a13d75bcbc7 to your computer and use it in GitHub Desktop.
cross-platform-releases-02-build-script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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