简体   繁体   English

如何从Codeship部署到AWS S3?

[英]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/ 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 目前设置的方式有点不同 ,我不知道在“本地路径”输入中写什么

在此输入图像描述

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>' 克隆到'/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. 您正在寻找路径/home/rof/src/bitbucket.org/<your_user>/<you_repository>

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 如果你想在该目录中上传一些内容,只需连接其他内容,如/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. 例如:您可以编译NodeJs应用程序并压缩dist目录以构建工件,然后将其上载到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 最后你的“本地路径”是: /home/rof/src/bitbucket.org/<your_user>/<you_repository>/upload

Hope this help!. 希望这有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM