Skip to content

Instantly share code, notes, and snippets.

@GuyHarwood
Created October 25, 2018 15:20
Show Gist options
  • Save GuyHarwood/cf72689c1fbe4f48508bf1aece71f8fc to your computer and use it in GitHub Desktop.
Save GuyHarwood/cf72689c1fbe4f48508bf1aece71f8fc to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -x
CWD=$(pwd)
# deploy app1
ADMIN_APP="${CWD}/app1"
TEMP_DIR=$(mktemp -d)
cd ${TEMP_DIR}
cp -a "${ADMIN_APP}" .
cd admin
rm -rf node_modules package-lock.json
git init
git add -A
git commit -q -m 'deploying app1'
heroku git:remote -a my-app
git push -f heroku master
cd ${CWD}
rm -rf ${TEMP_DIR}
# deploy app2
APP="${CWD}/app2"
TEMP_DIR=$(mktemp -d)
cd ${TEMP_DIR}
cp -a "${APP}" .
cd pupil
rm -rf node_modules package-lock.json
git init
git add -A
git commit -q -m 'deploying app2'
heroku git:remote -a my-app-2
git push -f heroku master
cd ${CWD}
rm -rf ${TEMP_DIR}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment