简体   繁体   English

Opsworks部署到自定义层

[英]Opsworks deploy to custom layer

I'm new to Opsworks, so hopefully this is a very easy question! 我是Opsworks的新手,所以希望这是一个非常简单的问题!

My setup is a custom PHP/Apache AMI (Amazon Linux) server layer, an RDS layer, and a PHP app named "abc_app" in an S3 bundle. 我的设置是一个自定义PHP / Apache AMI(Amazon Linux)服务器层,一个RDS层以及一个S3捆绑包中名为“ abc_app”的PHP应用程序。

I tried to deploy the app to a server instance. 我试图将应用程序部署到服务器实例。 It deployment finished successfully, but the code is not anywhere on the server, and nothing was in the /var/www/html directory where I expected it to be. 它的部署成功完成,但是代码不在服务器上的任何位置,并且/ var / www / html目录中的所有内容都没有出现。 The deploy log was not very helpful except that there was no mention of "abc-app" in it. 部署日志不是很有帮助,只是其中没有提及“ abc-app”。 I'm not sure if it should have it though. 我不确定是否应该拥有它。

So next I created the following JSON which explicitly sets the "deploy_to" attribute as described at http://docs.aws.amazon.com/opsworks/latest/userguide/attributes-json-deploy.html 因此,接下来我创建了以下JSON,该JSON明确设置了“ deploy_to”属性,如http://docs.aws.amazon.com/opsworks/latest/userguide/attributes-json-deploy.html中所述

{
    "deploy" : {
        "abc_app" : {
            "deploy_to" : "/var/www/html"
        }
    }
}

Once again, the deployment finished successfully, but the code is still not at /var/www/html or anywhere else. 再次,部署成功完成,但是代码仍然不在/ var / www / html或其他任何位置。

Any ideas or suggestions would be very much appreciated! 任何想法或建议将不胜感激!

The issue here is that you're using a custom layer, which is absolutely ok, you just need a custom deploy recipe which tells opsworks how to deploy your application. 这里的问题是您使用的是自定义层,这绝对可以,您只需要一个自定义部署配方即可告诉opsworks如何部署您的应用程序。

To deploy apps to a custom layer, you must implement custom Deploy recipes that download the app's files from a repository to the appropriate location on the instance. 要将应用程序部署到自定义层,您必须实现自定义部署食谱,该食谱将应用程序的文件从资源库下载到实例上的适当位置。 However, you can often limit the amount of code you must write by using the built-in deploy cookbook to handle some aspects of deployment. 但是,您通常可以使用内置的部署指南来处理部署的某些方面,从而限制必须编写的代码量。

http://docs.aws.amazon.com/opsworks/latest/userguide/create-custom-deploy.html http://docs.aws.amazon.com/opsworks/latest/userguide/create-custom-deploy.html

Hope this helps. 希望这可以帮助。

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

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