mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Added S3 support for pelican quickstart.
This commit is contained in:
parent
c3e9d0e96e
commit
62ab60d0b1
2 changed files with 10 additions and 1 deletions
|
|
@ -26,6 +26,7 @@ CONF = {
|
||||||
'ssh_port': 22,
|
'ssh_port': 22,
|
||||||
'ssh_user': 'root',
|
'ssh_user': 'root',
|
||||||
'ssh_target_dir': '/var/www',
|
'ssh_target_dir': '/var/www',
|
||||||
|
's3_bucket': 'my_s3_bucket',
|
||||||
'dropbox_dir': '~/Dropbox/Public/',
|
'dropbox_dir': '~/Dropbox/Public/',
|
||||||
'default_pagination': 10,
|
'default_pagination': 10,
|
||||||
'siteurl': '',
|
'siteurl': '',
|
||||||
|
|
@ -203,6 +204,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'])
|
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):
|
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'])
|
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:
|
try:
|
||||||
os.makedirs(os.path.join(CONF['basedir'], 'content'))
|
os.makedirs(os.path.join(CONF['basedir'], 'content'))
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ SSH_PORT=$ssh_port
|
||||||
SSH_USER=$ssh_user
|
SSH_USER=$ssh_user
|
||||||
SSH_TARGET_DIR=$ssh_target_dir
|
SSH_TARGET_DIR=$ssh_target_dir
|
||||||
|
|
||||||
|
S3_BUCKET=$s3_bucket
|
||||||
|
|
||||||
DROPBOX_DIR=$dropbox_dir
|
DROPBOX_DIR=$dropbox_dir
|
||||||
|
|
||||||
help:
|
help:
|
||||||
|
|
@ -33,6 +35,7 @@ help:
|
||||||
@echo ' rsync_upload upload the web site via rsync+ssh '
|
@echo ' rsync_upload upload the web site via rsync+ssh '
|
||||||
@echo ' dropbox_upload upload the web site via Dropbox '
|
@echo ' dropbox_upload upload the web site via Dropbox '
|
||||||
@echo ' ftp_upload upload the web site via FTP '
|
@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 ' github upload the web site via gh-pages '
|
||||||
@echo ' '
|
@echo ' '
|
||||||
|
|
||||||
|
|
@ -75,8 +78,11 @@ dropbox_upload: publish
|
||||||
ftp_upload: publish
|
ftp_upload: publish
|
||||||
lftp ftp://$$(FTP_USER)@$$(FTP_HOST) -e "mirror -R $$(OUTPUTDIR) $$(FTP_TARGET_DIR) ; quit"
|
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
|
github: publish
|
||||||
ghp-import $$(OUTPUTDIR)
|
ghp-import $$(OUTPUTDIR)
|
||||||
git push origin gh-pages
|
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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue