Skip to content
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 from

Conversation

j0nes2k
Copy link
Contributor

@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))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 ?

@saimn
Copy link
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
Copy link
Contributor Author

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 3 commits October 7, 2014 23:34
Fix saimn#118: allow passthrough of original files
- 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
Copy link
Contributor Author

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.

Added settings to give a different output filename than index.html
@saimn
Copy link
Owner

saimn commented Oct 14, 2014

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

- 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
Copy link
Contributor Author

j0nes2k commented Oct 15, 2014

Should be ready to merge now.

saimn added a commit that referenced this pull request Oct 15, 2014
@saimn
Copy link
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants