How to package and deploy serverless framework code in separate steps? - serverless-framework

My question is about separate package/deploy steps. What I want to do is to package the service at step 1 of the deployment process, then copy the content of the package to another machine and deploy from there. Can't make it work. I use no parameters, and "serverless package" seems to work fine (creates ".serverless" folder without an attempt to deploy), but when I copy the ".serverless" folder to another location and execute 'serverless deploy" it only says "packaging service" and does nothing. Is this how deployment of a package supposed to work? This happens on a vanilla aws node service.

The command serverless deploy --package path-to-package seems to be what you are looking for, as specified in the Serverless Framework documentation.
This deployment option takes a deployment directory that has already been created with serverless package and deploys it to the cloud provider. This allows you to easier integrate CI / CD workflows with the Serverless Framework.
You were probably missing the --package option.

Related

Azure DevOps deploy dotnet core package without IIS to deployment group

I am trying to figure out how to use deployment groups.
I have an artifact that contains an asp.net core website which uses "gRPC". grpc makes the package incompatible with IIS, but runs fine with dotnet ABC.dll. So thats what I try to do. Now when creating a release pipeline, only the IIS Stages have a description for the "Deployment group". All the others don't.
Basically I want to download my artifact to the servers in the deployment group, unpack the zip and execute dotnet run inside the folder.
Are there any other release stages compatible with deployment groups? Or should I try to use docker to run the artifact on the on-premise servers?
Update: The answer from Shayki works, i marked his post as answer. Anway, for anyone else as blind as me: after creating a task, you have the default "agent job". Delete that, and add a "deployment group job" with the 3 dots on the "deployment process" card instead:
You can add any task to a deployment group job, not only the IIS Stages. just add in the release a new Deployment group job and add there your tasks (unzip and dotnet run):
Because it's a Deployment group job the job will download the artifacts to each server that exist in the group and will invoke the tasks.

Nuxt webapp deployment through azure pipelines

i'm already thankfull for anyone reading this.
I've stumbled across some problems trying to deploy a Nuxt application in a correct way. For testing purposes i've created a clean installed Nuxt application so i'm sure nothing is wrong with my codebase. What my ultimate goal is is to push all my nuxt code to github which than gets picked up from a azure deployment pipeline and generates the needed build files and drops them to the webapp service and runs the needed start command. There's no documentation to be find about Azure which is really annoying for me. I'm not used to deploying stuff through a pipeline but need this to be working for this project.
Has anyone experience with Nuxt and deployments through Github -> Azure pipeline -> Build -> Web app running immediatly
What's i've tried already is pushing all the source code to a repository which get's picked up by azure pipeline. The only thing the pipeline does is paste the code in the wwwroot folder. Which is obviously not enough to make the application run automated.
What i expect is some insight from someone who is experienced with nuxt and azure deployments through github/bitbucket (doesn't really make a difference)
You have to configure your pipeline to build the nuxt files and deploy them. You can usually achieve the first step through npm commands, npm install then npm run build.
There's a few different ways to deploy them, which you'll have to decide between depending on your use case and environment. You can create an endpoint pointing to a CDN serving a blob, zip the built files and publish the artifact which is then used by a release pipeline, etc. Once the next files are created, you have all you need to deploy.

Override appveyor publish profile

I have an MVC 5 application we're moving from on-premise to the Azure cloud. Currently, we have several publish profiles, one per environment, which we determine using a powershell script. One of our goals is to make the building scripts and infrastructure as simple as possible, so I was wondering if I could make it so that using only my appveyor.yml file I could set the publish profile to be used, so
Is there a way to set the publish profile from the appveyor.yml file?
If not what are my choices?
You can run your PowerShell script as part of desired build step in pipeline. It is possible can run commands right from YAML file or UI or check-in your PowerShell script into repository and run .ps1 file. You might consider using secure variables to avoid checking in things like connection strings into repo in clear text.
However this custom script/profiles approach will not allow you to use built-in WAP artifacts packaging and you will be also needed to use custom script instead of automatic MSBuild mode. Which is OK, but a little bit more scripting. Also you will be needed to publish artifacts so it will be available for deployment.
Maybe easier option is to let AppVeyor do all build and WAP artifacts packaging/publishing automatically, and then use built-in Web Deployment with Web Deploy parametrization instead of multiple publishing profiles.
But if you decide to go with custom scripts, and multiple publishing profiles, you still can use use built-in Web Deployment with artifacts created by your scripts.

GitLab CI / CD: do I need docker for ASP.NET Core - Angular application

I am having self-hosted GitLab-EE. I want to enable CI / CD. I already have gitlab-runner on windows and it is activated for my project.
I also have custom server for hosting my ASP.NET Core 2.0 with Angular 5.0 application.
My final idea is when commit is made to GitLab, build and deploy (to custom server) is executed. Deploy path would be different if commit to master was made or any other branch (from merge request) conditional by Git Tag.
Almost all tutorials use docker, but I couldn't found why? What are the cons using docker?
I thought I only need msbuild (I can also install Visual Studio) on machine where GitLab-runner is running. It would build and deploy application. I found this configuration file which doesn't use docker, but question remains. Do I need docker and why?
A docker image would contain all the msbuild dependencies and build tools needed to build your application with out you going through the trouble of manually installing them on your server.
So basically docker helps you to manage dependencies of you application more efficiently.

Is it possible to apply web config transformation during installation of a package

If you have created a package having release1 configuration. and you want to use the same package to push it to live servers but you need to have different web config settings. Is it possible to install that package and also perform web config transformation for various other configurations (LIVE1, LIVE2). Please guide.
Instead of putting your Web.config transformations in a transformation file, you can use Web Deploy parameters. The parameter values can then be set during package installation either in the IIS Manager UI if you use that to install the package or in a file that you provide with the package if you install it using the command line. For an example, see Using Deployment Parameters for Web.Config File Settings in http://msdn.microsoft.com/en-us/library/ff398068(v=vs.110)
Another option is to use the PackageWeb Nuget package, which is currently a beta release:
http://nuget.org/packages/PackageWeb
PackageWeb is introduced in this blog:
http://sedodream.com/2011/12/24/PackageOncePublishAnywhere.aspx