您如何打包Visual Studio AWS无服务器项目? [英] How do you package up a visual studio aws serverless project?
问题描述
我正在尝试确定是否有一种方法可以自动打包aws无服务器项目,以便我们可以拆分构建和发布管道。
I'm trying to figure out if there is a way I can package up an aws serverless project in an automated way so that we can split our build and release pipeline up.
使用 dotnet lambda
命令行工具,可以看到有一个 dotnet lambda软件包
命令可以打包Lambda作为.zip文件准备部署。但是我找不到用于打包整个无服务器应用程序的任何东西。
Using the dotnet lambda
command line tools, I can see there is a dotnet lambda package
command to package the lambda as a .zip file ready for deployment. But I can't find anything for packaging the whole serverless application up.
这可能吗?如果是的话,我应该运行什么命令?
Is this possible? If so what commands do I run?
我们正在VSTS上运行Build和Release管道,但是只要时间不长,我真的不认为我会有所作为我可以将其脚本化。
We're running on VSTS for the Build and Release pipelines, however I don't really think I makes any difference as long as I can script it out.
推荐答案
通过将Lambda函数打包为带有 dotnet lambda package
命令,然后在 serverless.template
文件中进行复制,以备后用。
Looks like this is possible by packaging up the lambda function into a zip file with the dotnet lambda package
command and then copying across the serverless.template
file to be used later.
dotnet lambda package
有了我们的 *。zip
和我们的 serverless.template
方便之后,我们就可以运行 dotnet lambda deploy-serverless
,带有以下参数:
Once we've got our *.zip
and our serverless.template
handy we can then run the dotnet lambda deploy-serverless
with the following arguments:
dotnet lambda deploy-serverless --package .\drop\MyApp.zip --template .\drop\serverless.template
这篇关于您如何打包Visual Studio AWS无服务器项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!