- README entry about liveserver rsync+ssh sync
- fail to run if keys.py is missing - try-catch for sync because it's optional w
This commit is contained in:
parent
1f4a864d59
commit
f196b26b79
3 changed files with 32 additions and 8 deletions
16
README.md
16
README.md
|
@ -80,6 +80,22 @@ Install the pip dependency packages by using the Pipfile by running:
|
|||
|
||||
`pipenv install`
|
||||
|
||||
#### SSH (optional)
|
||||
|
||||
Once the build is done, NASG will attempt to sync the output folder to a remote server. It needs an entry in the `~/.ssh/config` file:
|
||||
|
||||
```
|
||||
Host liveserver
|
||||
HostName your.ssh.host
|
||||
User your.ssh.user
|
||||
IdentityFile ~/.ssh/your.ssh.identity.file
|
||||
IdentitiesOnly yes
|
||||
ServerAliveInterval 30
|
||||
|
||||
```
|
||||
|
||||
Note: if you don't have this, there will be no auto upload, but the build will still succeed.
|
||||
|
||||
### Prepare
|
||||
|
||||
Create a local base directory where your contents will be put into. Eg:
|
||||
|
|
19
nasg.py
19
nasg.py
|
@ -2342,15 +2342,18 @@ def make():
|
|||
|
||||
if not settings.args.get('nosync'):
|
||||
# upload site
|
||||
logger.info('starting syncing')
|
||||
os.system(
|
||||
"rsync -avuhH --delete-after %s/ %s/" % (
|
||||
settings.paths.get('build'),
|
||||
'%s/%s' % (settings.syncserver,
|
||||
settings.paths.get('remotewww'))
|
||||
try:
|
||||
logger.info('starting syncing')
|
||||
os.system(
|
||||
"rsync -avuhH --delete-after %s/ %s/" % (
|
||||
settings.paths.get('build'),
|
||||
'%s/%s' % (settings.syncserver,
|
||||
settings.paths.get('remotewww'))
|
||||
)
|
||||
)
|
||||
)
|
||||
logger.info('syncing finished')
|
||||
logger.info('syncing finished')
|
||||
except Exception as e:
|
||||
logger.error('syncing failed: %s', e)
|
||||
|
||||
if not settings.args.get('nosync'):
|
||||
logger.info('sending webmentions')
|
||||
|
|
5
run
5
run
|
@ -3,4 +3,9 @@
|
|||
set -euo pipefail
|
||||
IFS=$'\n\t'
|
||||
|
||||
if [ ! -f 'keys.py' ]; then
|
||||
echo "missing keys.py file; please copy keys.dist.py to keys.py and fill in the needed values inside"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
python3 nasg.py "$@"
|
||||
|
|
Loading…
Reference in a new issue