~exprez135/peer2peer

peer2peer/deploy.sh -rwxr-xr-x 1.5 KiB
149e0376 — Nate Ijams Add license. 2 years ago
                                                                                
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
43
44
45
46
47
48
49
#!/bin/bash

echo -e "\033[0;32mDeploying updates to GitLab...\033[0m"

# Remove current public folder to ensure all outdated files are gone.
echo -e "\033[0;32mRemoving outdated public folder\033[0m"
rm -r public

# Build the project.
echo -e "\033[0;32mStarting Hugo build process...\033[0m"
hugo -d public #this folder for committing to exprez135.github.io
echo -e "\033[0;32mHugo build process complete.\033[0m"
# OUTDATED hugo -d publicOrg #this folder for committing to hugo.thetaliaferrotimes.org

# Add changes to directories outside of public to git
echo -e "\033[0;32mTracking all git files...\033[0m"
git add .

# Go To Public folder
echo -e "\033[0;32mMoving into pubic_html folder...\033[0m"
cd public || exit
# OUTDATED OR, go to publicOrg folder for hugo.thetaliaferrotimes.org
# OUTDATED cd publicOrg

# OUTDATED Add changes to git.
# OUTDATED echo -e "\033[0;32mEnsuring public_html files are tracked...\033[0m"
# OUTDATED git add .

# Commit changes.
echo -e "\033[0;32mCommitting changes...\033[0m"
msg="rebuilding site $(date):"
echo -e "\033[0;32mWhat is your custom commit message? Leave blank for none.\033[0m"
read -r usrmsg

if [ $# -eq 1 ]
  then msg="$1"
fi
git commit -m "$msg $usrmsg"
echo -e "\033[0;32mChanges committed.\033[0m"

# Push source and build repos.
echo -e "\033[0;32mPushing origin master...\033[0m"
git push origin master
echo -e "\033[0;32mPushed.\033[0m"

# Come Back up to the Project Root
echo -e "\033[0;32mMoving back into Project Root...\033[0m"
cd ..
echo -e "\033[0;32mPROCESS COMPLETED.\033[0m"