Can I create the nuget package without create a database?
yeweinan
Posts: 3 New member
Hi Team,
I'm using the Azure DevOps plugin to create a build and release.
I feel like create the temp db during the build process is just for validating purpose?
Is there any way to by pass it? Many thanks
I'm using the Azure DevOps plugin to create a build and release.
I feel like create the temp db during the build process is just for validating purpose?
Is there any way to by pass it? Many thanks
Tagged:
Answers
Yes, the build process creates a database for validation purposes. If you skip this step, you would lose assurances that the code you have committed is valid SQL that is suitable for a deployment.
You have the option to have the build dynamically create the database for this purpose and drop it after, or if it is more convenient you can hardcode a name for the database and reuse an existing database for each build. (The database will be "cleaned" so validation can succeed.)
Can you explain why you would like to skip this step? Is there some barrier preventing you from using a database for this purpose, or some problem that you are hitting?
Cheers,
Kendra
Sorry for the slow response, and thanks for the information that build time sounds like it is a pain point.
Can I ask if you are using SQL Change Automation to deploy a SQL Source Control project, or is it a SQL Change Automation project that you are deploying with SQL Change Automation?
Thanks,
Kendra
There is a way that you can skip the build process if desired, by using the New-DatabaseProjectObject powershell cmdlet. Some notes on this:
- You would implement this using a PowerShell step in Azure DevOps, instead of the graphic plugin. The documentation page linked above has examples for doing this (one example is for a SQL Source Control project, one is for a SQL Change Automation project)
- The build process adds some additional value in terms of validation. It also creates a snapshot of the desired target schema which is used for things in the "Create Release Artifact" process, such as the changes report and the drift report. That means that if you skip the build process, you'll still have the ability to deploy, but won't have these extra features.
- As mentioned above, this also skips the validation process.
I think that what you are mentioning above is that you might have more than one kind of build pipeline, and only run the "full" build when you are generating a NUGET package that is planned to be deployed to production?I'm not entirely sure what your branching strategy and development database workflow is, but combining the two approaches might work, and then you would still get the changes report, the drift report, etc for your production release artifacts.
Cheers,
Kendra