-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.sh
executable file
·44 lines (32 loc) · 1.04 KB
/
deploy.sh
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
34
35
36
37
38
39
40
41
42
#!/bin/bash
echo -e "\033[0;32mDeploying updates to GitHub...\033[0m"
# Build the project
# extended regular expressions like !(.git) to remove all but .git files.
# shopt -s extglob
# remove old site data
find . -name "20*" -maxdepth 1 -print0 | xargs -0 rm -rd
# get publish directory (i.e., ./public)
DIR=$(pwd)
# find all bcdata-src repositories
find . -name "workshop20*" -print | while read f; do
#echo "start of loop" &&
#pwd | cat
# go to that directory
cd "$f" &&
#echo "directory:" &&
#pwd | cat &&
# run the buildSite script to build the site into e.g. public/2017
./scripts/buildSite.sh &&
# move that site from public/2017 to $DIR/2017
find ./public -name "20*" -maxdepth 1 | xargs -I '{}' mv {} $DIR &&
# go back up a directory
cd .. &&
pwd | cat
done
read -erp "Push workshopwebsite to origin? (y/n): " doPushToRemote
if [[ "$doPushToRemote" == "y" ]]
then
echo "Pushing to remote..."
read -erp "Commit Message: " commitMessage
git add 20* && git commit -m "$commitMessage" && git push origin master
fi