Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env bash
- set -xev
- display_usage() {
- echo "usage: sh "${0}" [flags]"
- echo "the list of flags:"
- echo " -b flag to build"
- echo " -d flag to build and deploy"
- }
- build() {
- mkdir -p public/js
- mkdir -p public/css
- export REACT_APP_API=http://crd-api.us-east-1.elasticbeanstalk.com
- rm -rf node_modules
- rm -rf build
- npm i
- npm run build
- cp build/static/js/main*.js public/js/main.js
- cp build/static/css/main*.css public/css/main.css
- }
- if [ $# -le 1 ]
- then
- display_usage
- exit 1
- fi
- while getopts db option
- do
- case ${option} in
- b)
- BUILD=1
- ;;
- d)
- DEPLOY=1
- ;;
- esac
- done
- if [[ BUILD -e 1 ]]
- then
- build()
- fi
- if [[ DEPLOY -e 1 ]]
- then
- eb deploy
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement