Skip to content

Instantly share code, notes, and snippets.

@AndrewDryga
Created August 19, 2017 15:33
Show Gist options
  • Save AndrewDryga/064293701bd811cf26a74048cdff12da to your computer and use it in GitHub Desktop.
Save AndrewDryga/064293701bd811cf26a74048cdff12da to your computer and use it in GitHub Desktop.
#!/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