Current section
Files
Jump to
Current section
Files
priv/templates/migrate.eex
#!/bin/sh
# Get remote console for the app
# This needs to be run under the app user account
# Exit on errors
set -e
CURDIR="$PWD"
BINDIR=$(dirname "$0")
cd "$BINDIR"; BINDIR="$PWD"; cd "$CURDIR"
SCRIPT_PREFIX="${SCRIPT_PREFIX:-deploy-}"
. $BINDIR/${SCRIPT_PREFIX}set-env
# Config vars
RELEASE_NAME="<%= release_name %>"
<%= case release_system do %>
<% :mix -> %>
MIGRATE_FUNCTION="${MIGRATE_FUNCTION:-<%= module_name %>.ReleaseTasks.Migrate.run}"
$CURRENT_DIR/bin/$RELEASE_NAME eval "$MIGRATE_FUNCTION"
<% :distillery -> %>
$CURRENT_DIR/bin/$RELEASE_NAME migrate
<% end %>