AWS CodeDeploy
User Guide (API Version 2014-10-06)
AWS 服务或AWS文档中描述的功能,可能因地区/位置而异。请点击 Amazon AWS 入门,可查看中国地区的具体差异

步骤 3:将示例应用程序上传到 GitHub 存储库

在此步骤中,您将示例修订从公有 Amazon S3 存储桶中复制到 GitHub 存储库。

注意

如果您使用您的某个修订而不是我们的示例修订,则您的修订必须:

如果您的修订满足这些要求,请向前跳至步骤 5:将应用程序部署到实例

如果您要部署到 Ubuntu Server 实例,则需将与 Ubuntu Server 实例和 AWS CodeDeploy 兼容的修订上传到您的 GitHub 存储库。有关更多信息,请参阅 计划修订添加 AppSpec 文件

例如,在您的终端或管理命令提示符在 /tmp/CodeDeployGitHubDemo 位置(对于 Linux, OS X, or Unix)或 c:\temp\CodeDeployGitHubDemo(对于 Windows)仍处于打开状态的情况下,运行以下命令(一次运行一条命令):

要将我们的示例修订推送到运行 Amazon Linux 或 RHEL 的 Amazon EC2 实例,请执行以下命令:

(Amazon S3 copy command)

unzip SampleApp_Linux.zip

rm SampleApp_Linux.zip

git add .

git commit -m "Added Linux sample app"

git push

其中,(Amazon S3 copy command) 为下列项之一:

  • aws s3 cp s3://aws-codedeploy-us-east-1/samples/latest/SampleApp_Linux.zip . --region us-east-1(对于美国东部(弗吉尼亚北部)区域)

  • aws s3 cp s3://aws-codedeploy-us-east-2/samples/latest/SampleApp_Linux.zip . --region us-east-2(对于美国东部(俄亥俄州)区域)

  • aws s3 cp s3://aws-codedeploy-us-west-1/samples/latest/SampleApp_Linux.zip . --region us-west-1(对于美国西部(加利福利亚北部)区域)

  • aws s3 cp s3://aws-codedeploy-us-west-2/samples/latest/SampleApp_Linux.zip . --region us-west-2(对于美国西部(俄勒冈)区域)

  • aws s3 cp s3://aws-codedeploy-ca-central-1/samples/latest/SampleApp_Linux.zip . --region ca-central-1(对于加拿大 (中部) 区域)

  • aws s3 cp s3://aws-codedeploy-eu-west-1/samples/latest/SampleApp_Linux.zip . --region eu-west-1(对于欧洲(爱尔兰)区域)

  • aws s3 cp s3://aws-codedeploy-eu-west-2/samples/latest/SampleApp_Linux.zip . --region eu-west-2(对于欧洲 (伦敦)区域)

  • aws s3 cp s3://aws-codedeploy-eu-central-1/samples/latest/SampleApp_Linux.zip . --region eu-central-1(对于欧洲(法兰克福)区域)

  • aws s3 cp s3://aws-codedeploy-ap-northeast-1/samples/latest/SampleApp_Linux.zip . --region ap-northeast-1(对于亚太区域(东京)区域)

  • aws s3 cp s3://aws-codedeploy-ap-northeast-2/samples/latest/SampleApp_Linux.zip . --region ap-northeast-2(对于亚太区域(首尔)区域)

  • aws s3 cp s3://aws-codedeploy-ap-southeast-1/samples/latest/SampleApp_Linux.zip . --region ap-southeast-1(对于亚太区域(新加坡))

  • aws s3 cp s3://aws-codedeploy-ap-southeast-2/samples/latest/SampleApp_Linux.zip . --region ap-southeast-2(对于亚太区域(悉尼)区域)

  • aws s3 cp s3://aws-codedeploy-ap-south-1/samples/latest/SampleApp_Linux.zip . --region ap-south-1(对于亚太地区(孟买)区域)

  • aws s3 cp s3://aws-codedeploy-sa-east-1/samples/latest/SampleApp_Linux.zip . --region sa-east-1(对于南美洲(圣保罗)区域)

  • aws s3 cp s3://aws-codedeploy-cn-north-1/samples/latest/SampleApp_Linux.zip . --region cn-north-1(对于南美洲(圣保罗)区域)

要将我们的示例修订推送到 Windows Server 实例,请执行以下命令:

(Amazon S3 copy command)

SampleApp_Windows.zip 的内容直接解压缩到本地目录 (例如 c:\temp\CodeDeployGitHubDemo),而不要解压缩到一个新的子目录中。

git add .

git commit -m "Added Windows sample app"

git push

其中,(Amazon S3 copy command) 为下列项之一:

  • aws s3 cp s3://aws-codedeploy-us-east-1/samples/latest/SampleApp_Windows.zip . --region us-east-1(对于美国东部(弗吉尼亚北部)区域)

  • aws s3 cp s3://aws-codedeploy-us-east-2/samples/latest/SampleApp_Windows.zip . --region us-east-2(对于美国东部(俄亥俄州)区域)

  • aws s3 cp s3://aws-codedeploy-us-west-1/samples/latest/SampleApp_Windows.zip . --region us-west-1(对于美国西部(加利福利亚北部)区域)

  • aws s3 cp s3://aws-codedeploy-us-west-2/samples/latest/SampleApp_Windows.zip . --region us-west-2(对于美国西部(俄勒冈)区域)

  • aws s3 cp s3://aws-codedeploy-ca-central-1/samples/latest/SampleApp_Windows.zip . --region ca-central-1(对于加拿大 (中部) 区域)

  • aws s3 cp s3://aws-codedeploy-eu-west-1/samples/latest/SampleApp_Windows.zip . --region eu-west-1(对于欧洲(爱尔兰)区域)

  • aws s3 cp s3://aws-codedeploy-eu-west-2/samples/latest/SampleApp_Windows.zip . --region eu-west-2(对于欧洲 (伦敦)区域)

  • aws s3 cp s3://aws-codedeploy-eu-central-1/samples/latest/SampleApp_Windows.zip . --region eu-central-1(对于欧洲(法兰克福)区域)

  • aws s3 cp s3://aws-codedeploy-ap-northeast-1/samples/latest/SampleApp_Windows.zip . --region ap-northeast-1(对于亚太区域(东京)区域)

  • aws s3 cp s3://aws-codedeploy-ap-northeast-2/samples/latest/SampleApp_Windows.zip . --region ap-northeast-2(对于亚太区域(首尔)区域)

  • aws s3 cp s3://aws-codedeploy-ap-southeast-1/samples/latest/SampleApp_Windows.zip . --region ap-southeast-1(对于亚太区域(新加坡))

  • aws s3 cp s3://aws-codedeploy-ap-southeast-2/samples/latest/SampleApp_Windows.zip . --region ap-southeast-2(对于亚太区域(悉尼)区域)

  • aws s3 cp s3://aws-codedeploy-ap-south-1/samples/latest/SampleApp_Windows.zip . --region ap-south-1(对于亚太地区(孟买)区域)

  • aws s3 cp s3://aws-codedeploy-sa-east-1/samples/latest/SampleApp_Windows.zip . --region sa-east-1(对于南美洲(圣保罗)区域)

  • aws s3 cp s3://aws-codedeploy-cn-north-1/samples/latest/SampleApp_Windows.zip . --region cn-north-1(对于南美洲(圣保罗)区域)

要将您自己的修订推送到 Ubuntu Server 实例,请将修订复制到您的本地存储库,然后调用:

git add . git commit -m "Added Ubuntu app" git push