我正在使用Kudu在Azure应用服务中部署我的应用程序。
默认情况下,kudu仅在laravel应用程序中运行composer install,但我还需要运行一些其他npm脚本才能使网站正常工作。
我尝试使用此documentation中所述的URL格式下载默认的deploy.cmd脚本:https://{sitename}.scm.azurewebsites.net/api/deploymentscript
但我收到一条错误消息:{"Message":"Operation only supported if not using a custom deployment script"}
对于我的下一个解决方案,我在本地Windows机器上全局下载了kuduscript cli,以在项目的根目录中生成默认的deploy.cmd,但是我也收到一条错误消息:
error: ENOENT: no such file or directory, open 'C:\Users\USER\AppData\Roaming\npm\node_modules\kuduscript\lib\templates\deploy.batch.php.template'
然后,我在php应用程序中找到了这个deploy.cmd模板: kudu repository
在我的部署中对其进行测试时,会导致以下错误:
Command: bash deploy.cmd
deploy.cmd: line 1: @if: command not found
deploy.cmd: line 3: ::: command not found
deploy.cmd: line 4: ::: command not found
deploy.cmd: line 5: ::: command not found
deploy.cmd: line 6: ::: command not found
deploy.cmd: line 8: ::: command not found
deploy.cmd: line 9: ::: command not found
deploy.cmd: line 11: ::: command not found
deploy.cmd: line 12: nul: Permission denied
deploy.cmd: line 13: syntax error near unexpected token `('
deploy.cmd: line 13: `IF %ERRORLEVEL% NEQ 0 ('
deploy.cmd: line 1: @if: command not found\r\ndeploy.cmd: line 3: ::: command not found\r\ndeploy.cmd: line 4: ::: command not found\r\ndeploy.cmd: line 5: ::: command not found\r\ndeploy.cmd: line 6: ::: command not found\r\ndeploy.cmd: line 8: ::: command not found\r\ndeploy.cmd: line 9: ::: command not found\r\ndeploy.cmd: line 11: ::: command not found\r\ndeploy.cmd: line 12: nul: Permission denied\r\ndeploy.cmd: line 13: syntax error near unexpected token `('\r\ndeploy.cmd: line 13: `IF %ERRORLEVEL% NEQ 0 ('\r\nD:\Program Files (x86)\SiteExtensions\Kudu\85.11024.4154\bin\Scripts\starter.cmd bash deploy.cmd
我已经没有选择了。
Laravel版本:5.8
运行时堆栈:PHP 7.2