【问题标题】:Azure KUDU deployment ignores project setting when deploy.cmd is specified指定 deploy.cmd 时 Azure KUDU 部署忽略项目设置
【发布时间】:2015-05-25 20:31:29
【问题描述】:

我的 nodeJS 存储库中有一个自定义 .deployment 文件,如下所示:

[config]
project = src/portal
command = deploy.cmd

如果我删除 command 设置,project 设置就会受到尊重。但是,我需要自定义部署脚本来执行一些 bower 和 grunt 命令。每当我重新添加 command 参数时,Azure/KUDU 似乎都会忽略 project 设置。我已恢复为使用 azure site deploymentscript --node 生成的默认 deploy.cmd 脚本,以确保我的自定义不是问题。问题依然存在。我错过了什么吗?

作为参考,这是 azure 的 KUDU 输出:

remote: Updating branch 'master'.
remote: Updating submodules.
remote: Preparing deployment for commit id '3f92585db0'.
remote: Running custom deployment command...
remote: Running deployment command...
remote: Handling node.js deployment.
remote: KuduSync.NET from: 'D:\home\site\repository' to: 'D:\home\site\wwwroot'
remote: Looking for app.js/server.js under site root.
remote: Missing server.js/app.js files, web.config is not generated
remote: The package.json file does not specify node.js engine version  constraints.
remote: The node.js application will run with the default node.js version 0.10.32.
remote: Finished successfully.
remote: Deployment successful.

【问题讨论】:

    标签: azure-web-app-service kudu


    【解决方案1】:

    这是设计使然,当您拥有自定义部署脚本时,您可以完全控制部署,因此project 属性没有任何意义。

    如果您需要不同的项目,只需使用您需要的内容更新自定义部署脚本。

    【讨论】:

    • 我终于想通了,但我没有找到任何明确的文档来说明这一点。我可以通过根据需要修改 deploy.cmd 脚本中的 DEPLOYMENT_SOURCE 变量来解决问题。
    • @Chris 你能详细说明你是如何解决这个问题的吗?我遇到了同样的问题。谢谢!
    • deploy.cmd脚本中有一行SET DEPLOYMENT_SOURCE=%~dp0%.我改成SET DEPLOYMENT_SOURCE=%~dp0%.\<path_to_folder_containing_app.js>
    猜你喜欢
    • 2014-01-14
    • 2014-11-27
    • 1970-01-01
    • 1970-01-01
    • 2016-12-23
    • 2012-07-22
    • 1970-01-01
    • 1970-01-01
    • 2013-08-07
    相关资源
    最近更新 更多