-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdeploy.sh
executable file
·51 lines (43 loc) · 1.19 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
43
44
45
46
47
48
49
50
51
#!/bin/bash
# @author Jacksgong
#
# @version 1.0.0
#
# For deplay public folder.
set -e
echo "==========---------Public-Release v4.0--------- =========="
hexo -v
node -v
npm -v
echo "==========>>>>>>prepare private key=========="
cp /opt/blog/.env .env
echo "==========>>>>>>start generate blog=========="
python3 run_with_private_key.py g
ls
echo "==========<<<<<<finish generate blog=========="
#echo "==========>>>>>>start push source code=========="
#bash push-double-end.sh
#echo "==========<<<<<<finish push source code=========="
echo "==========>>>>>>start push blog=========="
cd public
ls
rm -rf .git
git init
git remote add origin ssh://[email protected]:2222/jacks/blog-deploy.git
# Commit:
commit_date="$(date)"
git add --all
commit_msg="normal commit: $commit_date"
git commit -m "$commit_msg"
# Push:
git checkout -B master
git push --force origin master
echo "==========>>>>>>fninsh push blog=========="
# add marker
echo "==========>>>>>>start add deploy marker=========="
git clone ssh://[email protected]:2222/jacks/blog-deploy-auto-marker.git deploy-marker
cd deploy-marker
bash add-deploy.sh
cd ..
rm -rf deploy-marker
echo "==========<<<<<<finish add deploy marker=========="