Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deploy to AWS S3 from Codeship?

I have a question maybe a little silly, I'm trying to deploy a static site with codeship but I can't understand the documentation:

https://codeship.com/documentation/continuous-deployment/deployment-to-aws-codedeploy/

Currently it's a little different the way to setup, I don't know what to write in "Local Path" input

enter image description here

like image 669
Israel Barba Avatar asked Feb 11 '16 18:02

Israel Barba


People also ask

How do I import a CSV file into AWS?

Navigate to All Settings > Raw Data Export > CSV Upload. Toggle the switch to ON. Select Amazon S3 Bucket from the dropdown menu. Enter your Access Key ID, Secret Access Key, and bucket name.

Can we integrate S3 with EC2?

For your EC2 instance to connect to S3 endpoints, the instance must be one of the following: EC2 instance with a public IP address and a route table entry with the default route pointing to an Internet Gateway. Private EC2 instance with a default route through a NAT gateway.

Can you attach IAM policy to S3 bucket?

Attach the a policy to this IAM role to provide access to your S3 bucket. You can either grant your IAM role access to all of your S3 buckets or grant access to selected S3 buckets configured by custom policies: To grant your IAM role access to all of your S3 buckets, select the default AmazonS3FullAccess policy.


1 Answers

You should interpret "Local Path" as a reference to the working directory in the virtual machine.

It took me awhile to figure it out. You can see this in the cloning step. You will see something like this.

Cloning into '/home/rof/src/bitbucket.org/<your_user>/<you_repository>'

The path /home/rof/src/bitbucket.org/<your_user>/<you_repository> is what you are looking for.

If you want to upload something inside of that directory just concatenate the rest like /home/rof/src/bitbucket.org/<your_user>/<you_repository>/internal/path

For example: You can compile your NodeJs App and compress the dist directory to build an artifact and then upload it to S3.

It would be something like this. In your setups commands:

nvm use 5.6.0
npm install
npm run deploy
tar -zcvf artifact.tar.gz dist/
mkdir upload/
mv artifact.tar.gz upload/

Finally your "Local Path" is:/home/rof/src/bitbucket.org/<your_user>/<you_repository>/upload

Hope this help!.

like image 186
Alberto Menendez Romero Avatar answered Nov 03 '22 01:11

Alberto Menendez Romero