您必须从应用程序创建源包,请在此处查看详细信息:http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/applications-sourcebundle.html http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/applications-sourcebundle.html(或者您也可以使用AWS 代码提交 http://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html or AWS 代码构建 https://aws.amazon.com/codebuild/作为您的应用程序的来源。)
然后,您可以使用 AWS CLI 从您的应用程序创建新版本并将其部署到一个应用程序环境。 (请参阅 EBS 的 CLI 文档here http://docs.aws.amazon.com/cli/latest/reference/elasticbeanstalk/index.html#cli-aws-elasticbeanstalk.)
创建源包:
zip MyCodeBundle.zip <source files>
将其上传到 S3:
aws s3 cp MyCodeBundle.zip s3://a-bucket-where-you-store-your-source-bundles/
创建新的应用程序版本 http://docs.aws.amazon.com/cli/latest/reference/elasticbeanstalk/create-application-version.html使用您刚刚上传的源包:
aws elasticbeanstalk create-application-version --application-name YourEBSAppName --version-label YourVersionLabel --source-bundle S3Bucket="a-bucket-where-you-store-your-source-bundles",S3Key="MyCodeBundle.zip"
最后是你更新您的环境之一 http://docs.aws.amazon.com/cli/latest/reference/elasticbeanstalk/update-environment.html使用该版本(这是deploy即使这个动词在新版本中完全消失了适用于 EBS 的 AWS CLI http://docs.aws.amazon.com/cli/latest/reference/elasticbeanstalk/index.html#cli-aws-elasticbeanstalk- 这让我有点困惑):
aws elasticbeanstalk update-environment --application-name YourEBSAppName --environment-name YourEBSEnvironmentName --version-label YourVersionLabel