-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathcron-sh-example.txt
42 lines (31 loc) · 1.38 KB
/
cron-sh-example.txt
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
How to set it up:
1. Get and configure some web space to upload static HTML pages.
There are many options.
2. Get a machine that can run periodic cron jobs reliably.
Doesn't need to be publicly visible.
Choose the level of sandboxing according to your taste and set it up.
3. Set up a cron job running regularly on the machine.
It needs to run `make` and publish files under `html/` to your
static html storage. See below for example
As of Sep 2018, Planet Scipy hosts its static HTML on https://netlify.com (thanks!),
the cron machine is some box somewhere.
Steps taken:
1. create account and download netlifyctl
2. create access token and save to file ``token`` on server
3. `netlifyctl site create -n your-own-name-for-site -A $(cat token)`
4. look up the site ID on the web interface and save to file ``site-id``
the netlifyctl command needs it for uploading stuff
5. setup the cron and check manually everything works and uploads
6. update DNS `planet CNAME planetscipy.netlify.com.`
Example shell script for periodic updates with cron follows:
#!/bin/sh
set -e
cd /home/planetscipy/var
run() {
git -C staticplanet fetch origin
git -C staticplanet reset --hard origin/master
git -C staticplanet submodule update --init
make -C staticplanet
./netlifyctl deploy -A `cat token` -n planetscipy -s `cat site-id` -P staticplanet/html/
}
run < /dev/null > cron.log 2>&1