2020-01-24 11:36:51 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
stage_dir=_playlist-manager
|
|
|
|
|
|
|
|
echo '>> backing up a directory'
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
echo '>> deleting old deployment stage'
|
|
|
|
rm -rf $stage_dir
|
|
|
|
|
|
|
|
echo '>> copying main source'
|
|
|
|
cp -r playlist-manager $stage_dir
|
|
|
|
|
|
|
|
echo '>> injecting spotframework'
|
|
|
|
cp -r spotframework/spotframework $stage_dir/
|
|
|
|
|
|
|
|
echo '>> injecting fmframework'
|
|
|
|
cp -r fmframework/fmframework $stage_dir/
|
|
|
|
|
|
|
|
echo '>> injecting spotfm'
|
|
|
|
cp -r spotfm/spotfm $stage_dir/
|
|
|
|
|
|
|
|
cd $stage_dir
|
|
|
|
|
2020-02-03 23:37:18 +00:00
|
|
|
gcloud config set project sarsooxyz
|
|
|
|
|
|
|
|
echo '>>> Target?'
|
|
|
|
echo ''
|
|
|
|
echo '(0) > api'
|
|
|
|
echo '(1) > update_tag'
|
|
|
|
read deploy_target
|
|
|
|
|
|
|
|
|
|
|
|
case "$deploy_target" in
|
|
|
|
0)
|
|
|
|
echo '>> building css'
|
|
|
|
sass --style=compressed src/scss/style.scss build/style.css
|
|
|
|
|
|
|
|
echo '>> building javascript'
|
|
|
|
npm run build
|
|
|
|
|
|
|
|
echo '>> deploying'
|
|
|
|
gcloud app deploy
|
|
|
|
;;
|
|
|
|
|
|
|
|
1)
|
|
|
|
echo '>> deploying update_tag'
|
|
|
|
gcloud functions deploy update_tag
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
2020-01-24 11:36:51 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|