New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added plugin to upload generated gallery to Amazon S3 #114

Closed
wants to merge 16 commits into
base: master
from

Conversation

3 participants
@j0nes2k

j0nes2k commented Sep 28, 2014

With this plugin the generated gallery can be uploaded to Amazon S3. This plugin uploads everything in the build directory including images, HTML pages and static template assets.

logger.debug("Processing album: %s" % (album))
for media in album.medias:
upload_files.append(os.path.join(album.path, media.filename))
upload_files.append(os.path.join(album.path, gallery.settings['thumb_dir'], media.filename))

This comment has been minimized.

@saimn

saimn Oct 2, 2014

Owner

gallery.settings['thumb_dir'], media.filename must be replaced with media.thumb_path (the path depends on several settings). But maybe for this plugin it would be simpler to iterate on all the files of the destination directory ?

key = Key(bucket)
key.key = f
key.set_contents_from_filename(os.path.join(gallery.settings['destination'], f))
return None

This comment has been minimized.

@saimn

saimn Oct 2, 2014

Owner

The return here is useless

@saimn

This comment has been minimized.

Owner

saimn commented Oct 2, 2014

To get the list of files to upload it seems simpler to iterate on the destination directory:

for root, dirs, files in os.walk('sigal'):
    upload_files.extend(files)

Could you also add your plugin in the docs (docs/plugins.rst) ?

@j0nes2k

This comment has been minimized.

j0nes2k commented Oct 7, 2014

Yes, this is probably a good idea. Makes the plugin more robust for future
changes. I will have a look at this and modify the plugin.

saimn and others added some commits Oct 7, 2014

Merge pull request #119 from pitrou/passthrough
Fix #118: allow passthrough of original files
Improvements for upload to s3 plugin
- All files in the sigal build directory are now uploaded instead of manually building file list. This makes the plugin more robust for future changes.
- Added progressbar to check upload progress
- Added option to set a S3 permission policy (for example public-read or private) on all uploaded files
- Added option to skip files that were already uploaded before
- Added plugin to documentation
- Added plugin settings to default configuration template
@j0nes2k

This comment has been minimized.

j0nes2k commented Oct 12, 2014

I have just updated the plugin to simply upload all files that are present in the sigal build directory. I have also added some other improvements along the way. Please let me know if you have any comments about these changes.

Merge pull request #115 from j0nes2k/setting_output_filename
Added settings to give a different output filename than index.html
@saimn

This comment has been minimized.

Owner

saimn commented Oct 14, 2014

@j0nes2k: could you rebase on master so I can merge this ? Thanks

j0nes2k added some commits Sep 28, 2014

Improvements for upload to s3 plugin
- All files in the sigal build directory are now uploaded instead of manually building file list. This makes the plugin more robust for future changes.
- Added progressbar to check upload progress
- Added option to set a S3 permission policy (for example public-read or private) on all uploaded files
- Added option to skip files that were already uploaded before
- Added plugin to documentation
- Added plugin settings to default configuration template
Resolved conflict in AUTHORS file
Conflicts:
	AUTHORS
@j0nes2k

This comment has been minimized.

j0nes2k commented Oct 15, 2014

Should be ready to merge now.

saimn added a commit that referenced this pull request Oct 15, 2014

@saimn

This comment has been minimized.

Owner

saimn commented Oct 15, 2014

@j0nes2k : thanks but it seems that you made a merge. I have merged manually to keep a clean history ;)

@saimn saimn closed this Oct 15, 2014

@saimn saimn modified the milestone: 0.9 Aug 31, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment