Does anyone know how to do this? So far I haven’t been able to find anything useful via Google.
I’d really like to setup a local repo and use git push to publish it to S3, the idea being to have local version control over assets but remote storage on S3.
Can this be done, and if so, how?
1 Use JGit via http://blog.spearce.org/2008/07/using-jgit-to-publish-on-amazon-s3.html
Download jgit.sh, rename it to jgit and put it in your path (for example $HOME/bin).
Setup the .jgit config file and add the following (substituting your AWS keys):
$vim ~/.jgit
Note, by not specifying acl: public in the .jgit file, the git files on S3 will be private (which is what we wanted). Next create an S3 bucket to store your repository in, let’s call it git-repos, and then create a git repository to upload:
In the above I’m using the s3cmd command line tool to create the bucket but you can do it via the Amazon web interface as well. Now let’s push it up to S3 (notice how we use jgit whenever we interact with S3, and standard git otherwise):
Now go somewhere else (e.g. cd /tmp) and try cloning it:
When it comes time to update it (because jgit doesn’t support merge or pull) you do it in 2 steps:
2 Use FUSE-based file system backed by Amazon S3
Get an Amazon S3 account!
Download, compile and install. (see InstallationNotes)
Specify your Security Credentials (Access Key ID & Secret Access
Key) by one of the following methods:
using the passwd_file command line option
setting the AWSACCESSKEYID and AWSSECRETACCESSKEY environment variables
using a .passwd-s3fs file in your home directory
using the system-wide /etc/passwd-s3fs file
do this
.
That’s it! the contents of your amazon bucket “mybucket” should now be accessible read/write in /mnt