Created
August 19, 2017 15:33
-
-
Save AndrewDryga/064293701bd811cf26a74048cdff12da to your computer and use it in GitHub Desktop.
This file contains hidden or 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 -xe | |
# Create a release tarball | |
mix release --verbose | |
# Find tarball location | |
APP_NAME="myapp" | |
APP_TARBALL=$(find _build/${MIX_ENV}/rel/${APP_NAME}/releases -maxdepth 2 -name ${APP_NAME}.tar.gz) | |
# Unarchive tarball to /tmp/app | |
mkdir -p /tmp/app | |
tar -xzf "${APP_TARBALL}" -C /tmp/app | |
# Keep Procfile which is required by Heroku | |
cp Procfile /tmp/app | |
# Remove everything and copy released app back to the build directory | |
rm -rf ./* | |
cp -R /tmp/app/* ./ | |
rm -rf /tmp/app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment