-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdev_deploy
More file actions
executable file
·33 lines (27 loc) · 1.07 KB
/
dev_deploy
File metadata and controls
executable file
·33 lines (27 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# Usage: $ ./dev_deploy
# IMPORTANT: do not rely on the script to switch to development branch,
# please make sure that your local is clean and up to date before running
# this script.
if [ -z "$(git status --porcelain)" ] && [ -z "$(git diff origin/development..HEAD)" ]; then
# check uncommitted changes as well as potential unpushed commits
# working directory is clean, we can continue
# Make sure it's on development branch and up to date
echo "> 1. Double checking you are on development and it is up-to-date..." &&
echo "> \$ git checkout development" &&
git checkout development &&
echo "> \$ git pull" &&
git pull &&
echo "> 2. Building..." &&
echo "> \$ npm run build" &&
npm run build &&
echo "> 3. Deploying..." &&
echo "> \$ firebase deploy" &&
firebase deploy &&
echo "Done."
else
# there are uncommitted local changes, abort!
echo "> There are local changes, ABORTING!"
echo "> Make sure your working directory is clean (no uncommitted local changes or"
echo "> unpushed local commits) AND you are on development, AND it is up-to-date."
fi