你如何打包一个 Visual Studio aws 无服务器项目? [英] How do you package up a visual studio aws serverless project?

查看:15
本文介绍了你如何打包一个 Visual Studio aws 无服务器项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有办法以自动化的方式打包 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 package 命令可以将 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.

推荐答案

看起来可以通过使用 dotnet lambda package 命令将 lambda 函数打包到一个 zip 文件中,然后在整个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

一旦我们有了 *.zipserverless.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 .dropMyApp.zip --template .dropserverless.template

这篇关于你如何打包一个 Visual Studio aws 无服务器项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆