Skip to content

Instantly share code, notes, and snippets.

@lynsei
Created December 16, 2015 03:11
Show Gist options
  • Save lynsei/f55c15448fd26e7eb498 to your computer and use it in GitHub Desktop.
Save lynsei/f55c15448fd26e7eb498 to your computer and use it in GitHub Desktop.
/*`de x&* ``^~x&* *``^~x&*`` *``^~x&* *``^~x&*`` *``^~x&*`` *``^*``^~x~x&*``~ `*xc
`` `
` _____ ______ _________________________________ _____ ______ _______ (R) `
` | ||_____] | |______| | | | || \|______ `
` |_____||_____]__| |______|_____ | |_____ |_____||_____/|______ `
` `^*+**: Disruptiveware, LLP. `
` `
```'`'```'`'```````'``'``''``'````'`'`'``'````````'``'``'`'``'``'``'``'````'``'`'```'`'`'`
*/
My Notes on installing git-s3 and utilizing it in dev env:
I had to modify the upload function cause it was throwing errors on some files and they were fatal:
public function upload(File $file)
{
try
{ if (file_exists($file->getRealPath())) { /*-----------> line I modified */
$this->client->putObject(array(
'Bucket' => $this->name,
'Key' => $file->getRelativePathname(),
//'SourceFile' => $file->getRealpath(), /*-----------> line I modified */
'Body' => file_get_contents($file->getRealpath()),
'ACL' => CannedAcl::PUBLIC_READ,
));
} else echo "file does not exist: ".$file->getRealPath(); /*-----------> line I modified */
}
catch(InstanceProfileCredentialsException $e)
{
throw new InvalidAccessKeyIdException("The AWS Access Key Id you provided does not exist in our records.");
}
}
So after that it worked:
[[email protected] ~/rex.pub.git]$ git-s3 deploy
Already up-to-date.
Git s3 is required now, and I've deployed it on various packages. So yay!
GIT S3 IS REQUIRED FOR OBJECTCODE
--------------------------------------------------------------------------------------------
To INSTALL git-s3:
you can run the following commands (requires a global composer installation)
~bash> cd into a directory you can put composed dependencies inside
~bash> curl -sS https://getcomposer.org/installer | php
~bash> composer global require schickling/git-s3:dev-master
~bash> export PATH=~/.composer/vendor/bin:$PATH
NOTE: Any user on the server that wishes to execute git commands that are hooked
into Amazon S3 in this manner will need composer set up for themselves and to do so
they will need to execute the commands listed above.
--------------------------------------------------------------------------------------------
To initialize the configuration of a repository, generate a configuration:
~bash> git-s3 config
Enter your AWS access key ID:
Enter your AWS secret access key:
Enter your bucket title:
Enter the path where your repository lives:
Did you want to clone your repo (default is "n"): n
~ once the above has been completed you may then add a new file in your repo clone directory:
cd repo.src
touch newTestFile
git add .
git commit -m "New new test file was added"
~ once all the files you need have been added, you can deploy your package
~ this will upload everything to amazon s3 and make the necessary versioning changes to git
cd ..
git-s3 deploy
/*
--CHO
_____________________________________________________________________________________________________________________________________+
"Software as disruptive as our attitude"
~ http://disruptiveware.com
|8 888 d8888 8888888b. .d8888b. 8888888888
~+ad88RR88 |8 888 d88888 888 Y88b d88P Y88b 888
,8P'8 |8 888 d88P888 888 888 888 888 888
d8" D8 |8 888 d88P 888 888 d88P 888 8888888
,8P' 'I |8 888 d88P 888 8888888P" 888 88888 888
cd8" ' |8 888 d88P 888 888 T88b 888 888 888
.d8" |8 888 d8888888888 888 T88b Y88b d88P 888
dB" |8 88888888 d88P 888 888 T88b "Y8888P88 8888888888
__ ___ __________ __ ___ ____ _ ________
_____________________ ( (`/ / \| |_ | |\ \ // /\ | |_)| |_ | | | || | \ __
888888888888888888888 _)_)\_\_/|_| |_| \_\/\//_/--\|_| \|_|__ |_|__|_||_|_/(_()
EST. 2015;
_____________________________________________________________________________________________________________________________________+
*/ // eof
@lynsei
Copy link
Author

lynsei commented Dec 16, 2015

recently implemented s3 support for my git repos https://github.com/schickling/git-s3 ... here are my notes in case they help anyone

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