简体   繁体   English

如何将我的项目从 github 存储库转移到 aws 服务器? 我可以使用哪种类型的 aws 服务(ec2 或 s3)?

[英]how can i transfer my project from github repository to aws server? which type of aws services(ec2 or s3) i can use to do so?

I have already created an instance in ec2 and connected to the ssh我已经在 ec2 中创建了一个实例并连接到 ssh

how can I transfer my project from GitHub repository to AWS server?如何将我的项目从 GitHub 存储库转移到 AWS 服务器? which type of AWS services(ec2 or s3) i can use to do so??我可以使用哪种类型的 AWS 服务(ec2 或 s3)??

In the GitHub web UI, find the big green "Code" button and click on Code --> Download ZIP.在 GitHub web UI 中,找到绿色的大“代码”按钮并单击代码 --> 下载 ZIP。

Use scp to transfer it to your ec2 instance.使用scp将其传输到您的 ec2 实例。

Or use the amazon web console to upload the.zip to an S3 bucket.或者使用亚马逊 web 控制台将 .zip 上传到 S3 存储桶。 Or install CLI tools and use或者安装 CLI 工具并使用

$ aws s3 sync myproject.zip s3://mybucket/

I would say use the git clone command for your project and if your unable to create a key you can use git clone with the ssh option - which is the same but requires you to put password for every pull or push Regarding the instance if your deploying a application you should use the EC2 instance where as S3 instance is more often used for storing objects such as image files or other type of files but to run actual code you should use EC2我会说为您的项目使用 git 克隆命令,如果您无法创建密钥,您可以使用带有 ssh 选项的 git 克隆 - 这是相同的,但需要您为每次拉取或推送输入密码关于实例,如果您部署一个应用程序,您应该使用 EC2 实例,因为 S3 实例更常用于存储对象,例如图像文件或其他类型的文件,但要运行实际代码,您应该使用 EC2

The best way to do this is by using the git clone command.执行此操作的最佳方法是使用git clone命令。

Login to your ec-2 instance via ssh .通过ssh登录到您的ec-2实例。

ssh -i "/path/to/pem/file.pem" remote-name@ec2-xx-xx-xxx-xxx.us-xxxx-x.compute.amazonaws.com

After logging in, run the following:登录后,运行以下命令:

git clone <link to repo>

Please note that the link to repository is made available once you click on the Code button on your repo page.请注意,一旦您单击存储库页面上的Code按钮,存储库的链接就可用。

The other way of doing this, ie, downloading the repo and then uploading it to your ec-2 instance via scp is inefficient.执行此操作的另一种方法,即下载存储库然后通过scp将其上传到您的ec-2实例是低效的。 The secure copy ( scp ) is only good if you want to copy a project that resides in your local machine.安全复制 ( scp ) 仅适用于复制位于本地计算机中的项目。 Otherewise, there seems no purpose of first downloading and then uploading the whole project.否则,先下载然后上传整个项目似乎没有任何意义。

Also, I would not recommend putting your code base on s3 , as it is not made for this purpose.另外,我不建议将您的代码库放在s3上,因为它不是为此目的而制作的。 It is better if your project resides in ec-2 .如果您的项目驻留在ec-2中会更好。 If you want that your environment persists when your stop and again start your instance, then use ebs instead.如果您希望您的环境在您停止并再次启动您的实例时持续存在,请改用ebs

暂无
暂无

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

相关问题 我如何构建一个 aws 云监控,它会在启动任何新资源(ec2 或 rds 或 s3)时发出警报 - How do I build a aws cloud monitoring which alerts when any new resource (ec2 or rds or s3) is launched AWS Neptune:尽管我可以从我的 EC2 实例连接到数据库,但笔记本电脑未连接 - AWS Neptune: Notebook Does Not Connect Though I Can Connect to the DB from my EC2 Instance 无法在 AWS 上的 EC2 实例上从 S3 读取 csv 到 pyspark dataframe - Can't read csv from S3 to pyspark dataframe on a EC2 instance on AWS 我可以将 mongodb atlas 数据移动到 aws ec2 吗 - Can I move mongodb atlas data to aws ec2 我如何从特定的 ec2 实例获得对 s3 的 putobject 访问权限 - How can i get putobject access to s3 from specific ec2 instance 如何在 EC2 Connect AWS 中复制/粘贴 - How do I copy/paste in EC2 Connect AWS AWS EC2 实例“无法访问此站点”,但我确实打开了端口 80 和 443 - AWS EC2 instance "This site can't be reached", though I do have the ports 80 and 443 open 我可以将文件从 Sharepoint 复制到 AWS S3 吗? - can I copy a file from Sharepoint to AWS S3? aws 发送命令不将文件从 s3 存储桶复制到 windows 服务器 ec2 实例 - aws send command not copying file from s3 bucket to windows server ec2 instance 如何将 AWS lambda 环境变量传递给用户数据脚本(脚本将在 ec2 启动期间触发) - How can I pass AWS lambda environement variable into userdata script ( script will fire during ec2 spinup)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM