serverless-framework - 创建自定义无服务器模板时,“ServerlessError: serverless.yml not found”错误
问题描述
我试图创建一个自定义无服务器模板。
它是在我所做的所有无服务器项目之间共享相同的文件结构。
$ serverless create --template-url https://git-repository-url --path myService
以下是serverless
模板的 git 存储库结构。
但是,当我运行上面的命令时,它会返回错误。
Serverless: Downloading and installing "xxxxxxxxxxx"...
Serverless Error ---------------------------------------
serverless.yml not found in /......../myService
Get Support --------------------------------------------
Docs: docs.serverless.com
Bugs: github.com/serverless/serverless/issues
Issues: forum.serverless.com
Your Environment Information -----------------------------
OS: darwin
Node Version: 10.6.0
Serverless Version: 1.32.0
我做错了什么?
severless.yml
如果我克隆存储库,我可以在根目录中看到一个文件。
解决方案
我应该使用 git 源路径 URL 而不仅仅是 git 存储库 URL。
# For github
https://github.com/user/repository-name/tree/branch-name/dir-path
# For bitbucket
https://bitbucket.com/user/repository-name/src/branch-name/dir-path
推荐阅读
- node.js - npm install package 作为主项目,而不是依赖项
- linux - (初学者)如何优化这个脚本?
- php - php根据数组跳过并开始获取数字
- scala - 如何在火花中应用K最近邻?
- powershell - 如何创建不需要输入 Powershell 的函数参数
- vue.js - Vue.js、GitHub、Heroku - 如何动态、安全地设置环境变量?
- python - 带有 Azure SQL Server、字符串或二进制数据的 pyodbc 将被截断。(8152)
- ansible - 如何包含来自组中所有主机的所有主机密钥
- vlc - 从终端启动 VLC 并从一开始将默认渲染器设置为 ChromeCast(无 GUI)
- python - 使用 Django、Requests 和 Microsoft Graph 将数据发布到 Outlook 日历