diff --git a/abra.sh b/abra.sh index 4413bc9..370b02c 100755 --- a/abra.sh +++ b/abra.sh @@ -1,8 +1,8 @@ #!/bin/bash -# set -x export ENTRYPOINT_CONF_VERSION=v12 + file_env() { local var="$1" local fileVar="${var}_FILE" @@ -35,40 +35,32 @@ environment() { declare -x RAILS_ENV=production } - -setup_assets() { - environment - bundle exec rails assets:precompile -} - -setup_db() { - environment - bundle exec rake db:setup -} - setup_admin() { + ## Create an admin user environment accounts create "$1" --email "$2" --confirmed --role admin } shell() { + ## Run a shell with proper environment environment bash $@ } generate_secrets() { - ## Run this 'local' to generate secrets + ## Run `abra app cmd -l generate_secrets` to use Docker to generate secrets you'll need to deploy + ## your new instance (and create the secrets on target app). docker context use default > /dev/null 2>&1 echo "Generating secrets for new Hometown deployment..." echo "" - SECRET_KEY_BASE=$(docker run --rm tootsuite/mastodon:v3.4.0 bundle exec rake secret) + SECRET_KEY_BASE=$(docker run --rm tootsuite/mastodon:v4.2.0 bundle exec rake secret) abra app secret insert "$APP_NAME" secret_key_base v1 "$SECRET_KEY_BASE" echo "SECRET_KEY_BASE = $SECRET_KEY_BASE" echo "" - OTP_SECRET=$(docker run --rm tootsuite/mastodon:v3.4.0 bundle exec rake secret) + OTP_SECRET=$(docker run --rm tootsuite/mastodon:v4.2.0 bundle exec rake secret) abra app secret insert "$APP_NAME" otp_secret v1 "$OTP_SECRET" echo "OTP_SECRET = $OTP_SECRET" echo ""