Skip to content

Instantly share code, notes, and snippets.

@codeopensrc
Last active August 29, 2015 14:21
Show Gist options
  • Save codeopensrc/6dff1263c63d71a6da78 to your computer and use it in GitHub Desktop.
Save codeopensrc/6dff1263c63d71a6da78 to your computer and use it in GitHub Desktop.
Deploy Webpack files and DB functions to Github and Heroku (project specific atm)
#!/bin/bash
- # Stack overflow of course helped, parentheses create a "sub-shell" that returns
- # to the original directory it was run in.
(cd src/E*/E* && make development)
git add -A
git reset -- src/E*/E*/public/bundle.js
read -p "Enter message for commit > " message
git commit -m "$message"
git add -A
git commit -m "add bundle"
git push origin master
git push heroku master
echo; echo; echo;
echo "Please make sure the .sql files in the D2_SQL folder are up to date. They will be pushed to the server DB."
echo "If they are, push 'y' to continue with the deployment, otherwise push any key to exit."
echo
read -n 1 -p "Press y to continue > " input
echo
if [ ! -z $input ] && [ $input == 'y' ]
then
# Concat all files in D2 dir into a file, push file to heroku DB instance.
(cd src/D*/D2* && cat *.sql > file && cat file | heroku pg:psql --app ree-nh-test && rm file)
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment