diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 02aa62d3..7fdaa489 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -26,6 +26,7 @@ CONF = { 'ssh_port': 22, 'ssh_user': 'root', 'ssh_target_dir': '/var/www', + 's3_bucket': 'my_s3_bucket', 'dropbox_dir': '~/Dropbox/Public/', 'default_pagination': 10, 'siteurl': '', @@ -204,6 +205,8 @@ needed by Pelican. CONF['ssh_target_dir'] = ask('Where do you want to put your web site on that server?', str_compat, CONF['ssh_target_dir']) if ask('Do you want to upload your website using Dropbox?', answer=bool, default=False): CONF['dropbox_dir'] = ask('Where is your Dropbox directory?', str_compat, CONF['dropbox_dir']) + if ask('Do you want to upload your website using S3?', answer=bool, default=False): + CONF['s3_bucket'] = ask('What is the name of your S3 bucket?', str_compat, CONF['s3_bucket']) try: os.makedirs(os.path.join(CONF['basedir'], 'content')) diff --git a/pelican/tools/templates/Makefile.in b/pelican/tools/templates/Makefile.in index 784a53e4..e20fc612 100644 --- a/pelican/tools/templates/Makefile.in +++ b/pelican/tools/templates/Makefile.in @@ -16,6 +16,8 @@ SSH_PORT=$ssh_port SSH_USER=$ssh_user SSH_TARGET_DIR=$ssh_target_dir +S3_BUCKET=$s3_bucket + DROPBOX_DIR=$dropbox_dir help: @@ -33,6 +35,7 @@ help: @echo ' rsync_upload upload the web site via rsync+ssh ' @echo ' dropbox_upload upload the web site via Dropbox ' @echo ' ftp_upload upload the web site via FTP ' + @echo ' s3_upload upload the web site via S3 ' @echo ' github upload the web site via gh-pages ' @echo ' ' @@ -75,8 +78,11 @@ dropbox_upload: publish ftp_upload: publish lftp ftp://$$(FTP_USER)@$$(FTP_HOST) -e "mirror -R $$(OUTPUTDIR) $$(FTP_TARGET_DIR) ; quit" +s3_upload: publish + s3cmd sync $(OUTPUTDIR)/ s3://$(S3_BUCKET) --acl-public --delete-removed + github: publish ghp-import $$(OUTPUTDIR) git push origin gh-pages -.PHONY: html help clean regenerate serve devserver publish ssh_upload rsync_upload dropbox_upload ftp_upload github +.PHONY: html help clean regenerate serve devserver publish ssh_upload rsync_upload dropbox_upload ftp_upload s3_upload github