- README entry about liveserver rsync+ssh sync - fail to run if keys.py is missing - try-catch for sync because it's optional w
Peter Molnar hello@petermolnar.eu
Wed, 10 Apr 2019 09:37:24 +0100
M
README.md
→
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:
M
nasg.py
→
nasg.py
@@ -2342,15 +2342,18 @@ logger.info('process took %d ms' % (end - start))
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')