-
Notifications
You must be signed in to change notification settings - Fork 4
/
updater.sh
executable file
·50 lines (39 loc) · 2.06 KB
/
updater.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
#!/bin/bash
## Local
#cd /home/slisakov/yadisk/sites/open-source-comments
#cd /Users/slisakov/Yandex.Disk.localized/sites/open-source-comments
## Remote
cd /home/slisakov/open-source-comments
echo 'git pull'
nice -n5 git pull
# Update the data on gh stars, last commit etc
echo 'python3 get_data.py'
nice -n5 python3 get_data.py
# Update date in index.html
echo 'python3 md_to_html.py'
nice -n5 python3 md_to_html.py
# generate data.js (read by index.html)
echo 'python3 yaml_2_js.py'
nice -n5 python3 yaml_2_js.py
# Plot stars-vs-date and save stars-v-date.png
echo 'python3 plot-stars.py'
nice -n5 python3 plot-stars.py
## Deploy changes
echo 'rsync'
### Local
#nice -n5 rsync -auvx --delete --numeric-ids data.js index.html stars-v-date.png [email protected]:/var/www/lisakov.com/projects/open-source-comments/
#nice -n5 rsync -auvx --delete --numeric-ids images/ [email protected]:/var/www/lisakov.com/projects/open-source-comments/images/
#nice -n5 rsync -auvx --delete --numeric-ids css/ [email protected]:/var/www/lisakov.com/projects/open-source-comments/css/
#nice -n5 rsync -auvx --delete --numeric-ids js/ [email protected]:/var/www/lisakov.com/projects/open-source-comments/js/
# Remote
nice -n5 rsync -auvx --delete --numeric-ids data.js index.html stars-v-date.png /var/www/lisakov.com/projects/open-source-comments/
nice -n5 rsync -auvx --delete --numeric-ids images/ /var/www/lisakov.com/projects/open-source-comments/images/
nice -n5 rsync -auvx --delete --numeric-ids css/ /var/www/lisakov.com/projects/open-source-comments/css/
nice -n5 rsync -auvx --delete --numeric-ids js/ /var/www/lisakov.com/projects/open-source-comments/js/
# update github repository https://github.com/pozitron57/open-source-comments
echo 'git add *'
nice -n5 git add *
echo 'git commit -m 'automatic update''
nice -n5 git commit -m 'automatic update'
echo 'git push origin master'
nice -n5 git push origin master