How to create users in postgrel db from jenkins pipeline - pipeline

I need the steps for configuring it in the pipeline groovy code

Related

How we can store jenkins build id in firebase using jenkins deploy pipeline?

I want to connect Jenkins with Firebase and want to store current build id in Firebase.
I didn't found any plugin in jenkins to connect with firebase and have little bit knowledge of jenkins so unable find working solution which helps me.

Trigger Amplify deplyoment for a NextJS SSR app in Gitlab Pipeline

I am deploying a NextJS SSR app in Amplify.
I am also running linters and tests in a Gitlab (cloud) Pipeline.
My workflow should be this:
Push changes into a branch.
Run the Gitlab Pipeline.
Deploy the new code (if the pipeline succeeds).
What I need is a mechanism to trigger the deployment inside the Gitlab Pipeline.
However, the documentation of Amplify says this:
Amplify Hosting does not support manual deploys for server-side rendered (SSR) apps.
That means the deployment is triggered by a push into a branch. Do you know any solution to trigger the deployment after the Gitlab Pipeline succeeded?

Azure Pipelines doesn't compile my repository code, just clones it

I've a application built with ASP.NET, and would like to integrate Virtual Machine with CI/CD service of Azure DevOps. I'm sure that Web Deploy is installed in VM, Agent Pool is configurated and Azure Pipelines is "linked" with Agent Pool and Github repository. But when i execute the Pipeline, it don't generate any error ,however instead of compile or publish the code, it simply clone which is in repository and copy to _work/1/s inside VM. Could someone help me?
There are probably no corresponding tasks for compiling or publishing in your pipeline.
As you are building a ASP.NET application and using Classic UI pipeline, you can apply ASP.NET template:
In the template:
The 'Build solution' task is for building and 'Publish Artifact' task is for publishing.
If you want to know detailed information of a task, click it and choose 'More Information'. It will link you to the document for the task.
To learn more about build and release tasks, you can read this document.

Deployment Variables for Azure .Net Core Web App

I am having trouble getting the desired result from my CI/CD pipeline when deploying a .Net Core 2.0 web app to Azure.
As it stands everything is working when I deploy to my test environment. I have added a setting - ConnectionString:Main - to link to the correct database in the AppSettings section for the development app in the Azure portal.
I now want to deploy to my production environment. The issue is that there are two production databases, only one of which is "live" any any one time. What I would like to do is create two release definitions, one for each database and then have the ability to deploy using either one.
Is it possible to simply add a release variable that will override the local connection string in AppSettings.json as it was with previous .Net versions or is a more complex solution required?
You can use JSON variable substitution feature of Azure App Service Deploy task, for example, replace the value of ConnectionString in the sample below, you can define a release/environment variable as Data.DefaultConnection.ConnectionString in release definition.
{
"Data": {
"DefaultConnection": {
"ConnectionString": "Server=(localdb)\SQLEXPRESS;Database=MyDB;Trusted_Connection=True"
}
}
}
When using ASP.NET Core apps on Azure, the recommended way to store secrets is by using Azure Key Vault. This makes sure that no credentials are stored in version control or in VSTS.
If you really want to update a configuration value during deployment, you can tokenize your parameters and replace them during deployment. You can use this marketplace task for that. Managing Config for .NET Core Web App Deployments with Tokenizer and ReplaceTokens Tasks describes how to use these tasks.
You should be able to accomplish this by creating the deployment via ARM template and creating different parameters files for each environment. Using the template the relevant app settings can be replaced, which will inject them into the Azure portal Application Settings. These settings will override what is checked into your config file in the repo.

Deploying ASP.NET 5 application with backing DB on client servers

I'm writing an ASP.NET 5 application targetting .Net Core using EF7. When I'm done, I'd like to publish the application to a platform-specific installer that, when run, will install a service, deploy a database based on user-input credentials for a SQL Server. The service will self-host the ASP.NET application.
Is this possible? How would I go about achieving this?
Thanks!
We use MSDeploy at work to deploy all of our components: web applications, windows services, scheduled task, SQL databases, etc.
You could use the following command to package up the service code:
msdeploy -verb:sync -source:dirPath=/path/to/service -dest:package=servicePackage.zip -verbose
And this command to deploy it to the target:
msdeploy -verb:sync -source:package=/path/to/service -dest:package=servicePackage.zip -verbose
Use a database project for the SQL database and create a DacPac to publish. You can use MSDeploy to publish the DacPac:
MSDeploy –verb: MSDeploy-verb –source:dbSqlPackage="db.dacpac"[,dbSqlPackage-source-parameters] –dest:dpSqlPackage="TargetConnectionString"[,dbSqlPackage-target-parameters]
Finally use Manifests to wrap it all up into a single MSDeploy package.
Regarding the user input values for the database, I would use WebDeploy Parameterization files to define the variables and apply them to the database deployment. These parameterization files can be used for non-web deployments via MSDeploy. Then write some PowerShell to wrap the MSDeploy command for deployment to prompt the user for their inputs and edit the SetParameters file.

Resources