python - 使用 az webapp deployment source 从 git 部署代码,但当应用位于 git 存储库子文件夹中时
问题描述
我正在尝试将代码从我的 gitlab CI 运行器部署到 Azure。我正在使用az webapp deployment
来完成这项工作:
az webapp deployment source config --branch master --manual-integration --name [myWebApp] --repo-url [git url] --app-working-dir [folder] --resource-group [myResourceGroup]
但是有一个问题,默认工作目录是 git 的根文件夹。我的应用程序位于根目录的子文件夹中。我检查了命令配置,我再次看到了--app-working-dir
哪个可以满足我的要求,但只有在--cd-project-url
设置时才有效(我不需要而且我没有使用 VSTS)。此外,没有使用此配置的示例。我希望有一个类似于我通过 azure cloud shell 部署时使用的命令集:cd <app-folder>; az webapp up --sku B1 --name <app-name>
. 有没有办法以更简单的形式进行部署?
解决方案
在 git 存储库的根目录中创建一个 .deployment 文件。并在配置中添加项目子文件夹。届时它将起作用。
https://github.com/projectkudu/kudu/wiki/Customizing-deployments
推荐阅读
- android - 在 Java Android 中将 Parcelable 和 JSON 字符串放入 Intent
- google-cloud-platform - 谷歌云 Kubernetes - 套接字服务器
- regex - Powershell正则表达式匹配括号之间的字符串
- mysql - django __date 在 MySQL 中返回 None 而在 Sqlite3 中返回日期对象
- javascript - React-Redux 增量/减量问题
- python - 删除从 pandas DataFrame 中删除的图像文件
- android - 如何动态更新幻灯片菜单的项目(没有“recreate()”)
- python - 使用多个循环的列表理解
- python - Dask,根据下一行添加新列
- python - GUIzero:“'int' 对象不可下标”,变量强制为字符串