在AWS Elastic Beanstalk上部署后运行PHP脚本 [英] Run PHP script after deployment on AWS Elastic Beanstalk

查看:73
本文介绍了在AWS Elastic Beanstalk上部署后运行PHP脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个PHP脚本,该脚本使用所需的数据库设置和凭据为Magento生成了local.xml文件.部署应用程序后,我需要运行此程序.但是我似乎无法找到一种方法.我的理解是,我需要在.ebextensions目录中创建一个.config文件.有人有解决办法吗?

I've created a PHP script that generates a local.xml file for Magento with the required database settings and credentials. I need to run this after the application is deployed; however I cannot seem to figure out a way to do so. My understanding is that I need to create a .config file inside of a .ebextensions directory. Anyone have a solution?

推荐答案

是的,.ebextensions是您要寻找的.要查看如何捆绑源,请查看示例应用程序.您也可以查看一种PHP.

Yup, .ebextensions are what you are looking for. To see how to bundle the source, take a look at the sample applications. There is a PHP one you can look at as well.

有关.ebextensions的更多信息,请查看此页面.

For more info on .ebextensions, take a look at this page.

这是自定义命令的示例.这可以放在.ebextensions目录中的名为sample.config的文件中:

Here's an example of a custom command. This could go in a file called sample.config within the .ebextensions directory:

commands:
    success_command:
        command: echo "this will be ran after launching"

如果您复制并粘贴YAML并仔细检查格式,请当心.您还可以使用遵循类似格式的JSON.

Be careful if you copy and paste YAML and double check the format. You can also use JSON which follows the similar format.

这篇关于在AWS Elastic Beanstalk上部署后运行PHP脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆