azure - 使用控制台将 git clone 存储库转换为 powershell azure 函数
问题描述
git clone
在 Azure 函数 powershell 7.0 上运行命令的正确 sintaxis 是什么?
我正在尝试:git clone <repo https>
并在最后添加路径git clone <repo https> /.
我收到以下错误消息:
`Command 'starter.cmd git clone https ...' was aborted due to no output nor CPU activity for 60 seconds. You can increase the SCM_COMMAND_IDLE_TIMEOUT app setting (or WEBJOBS_IDLE_TIMEOUT if this is a WebJob) if needed.`
*更新:
也试过了git clone https://username:password@github.com/username/repository.git
克隆到 ''... 致命:无法访问 'https://github.com//.git/':URL 使用错误/非法格式或缺少 URL
我还没有找到任何关于这方面的文档……这有可能吗?
解决方案
我首先要问您这样做是为了达到什么目的,因为这有点奇怪,并且可能有更好的方法将存储库克隆为管道的一部分并使用您的函数发布内容。
如果你真的必须走这条路,我会考虑用 Invoke-RestMethod/Invoke-WebRequest 下载 repo/branch 内容,然后解压到底层目录结构。
Invoke-WebRequest -Uri 'https://github.com/$owner/$repo/archive/$branch.zip' -OutFile '$repo.zip'
或使用像 Matthias 在此响应中指出的 .NET 方法: https ://stackoverflow.com/a/48547954/12040634
推荐阅读
- jquery - 如何在 Jquery 脚本中编写动态 URL
- swift - 隐藏标签中的文本时尝试调整 UIView 的大小
- android - 从 Firebase 动态链接获取查询参数
- laravel - 创建自己的 laravel 包
- javascript - next.js:是否可以只为 google bot 和其他爬虫做 SSR,而不是为用户做 SSR?
- android - 在自定义视图中设置数据
- javascript - 在 ChartJS 图表的工具提示中添加多个值
- javascript - 如何在屏幕上更新数据库中的更新。ASP.NET MVC
- python - Python 的 shutil.rmtree() 是阻塞调用吗?
- java - 如何诱导字符串的顺序并与之比较?