forked from yaodong/pentitugua-rss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scheduled.sh
41 lines (29 loc) · 847 Bytes
/
scheduled.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
#!/usr/bin/env bash
if [ ! -d /srv/pentitugua ]; then
git clone git@github.com:yaodong/pentitugua-rss.git /srv/pentitugua
fi
if [ ! -d /srv/gh-pages ]; then
git clone -b gh-pages --single-branch git@github.com:yaodong/pentitugua-rss.git /srv/gh-pages
fi
while true;
do
cd /srv/pentitugua
git fetch origin
git reset --hard origin/master
pip3 --no-cache-dir install -r requirements.txt
python3 manage.py download
git add .
git commit -m "update at $(date '+%Y-%m-%d %H:%M:%S')"
git push -u origin master
cd /srv/gh-pages
git fetch origin
git reset --hard origin/gh-pages
cd /srv/pentitugua
python3 manage.py build
cd /srv/gh-pages
git add .
git commit -m "update at $(date '+%Y-%m-%d %H:%M:%S')"
git push -u origin gh-pages
echo "sleep"
sleep 1800
done