Options

Deploying a database package to SQL Server through Octopus & TeamCity

I am implementing CI/CD for SQL Server Database through Redgate software and TeamCity. I manage to Build and push the NuGet Database Package to Octopus. I can see the NuGet package in Library section of Octopus. But I am facing issues in deploying that package to SQL Server. I cant find the Step Template "Deploy a NuGet package" in Octopus process section. I have also tried "Deploy a package" step template but it didnt worked.I am following this guide.

https://documentation.red-gate.com/sr1/worked-examples/deploying-a-database-package-using-octopus-deploy-step-templates

Any Help will be highly appreciated
Tagged:

Answers

  • Options
    Hey Jeet,

    Deploy a Package is the correct first step - you have to specify the Package ID


    After the deploy a package - then you would use the Redgate - Create Database Release step template to create the update script and report, and the Redgate - Deploy Database Release step template to run the update script.(probably with a Manual Intervention or Review step in between)

    Hope that helps!

    Cheers,
    Andrew Pierce
    Technical Sales Engineer
    Redgate Software
  • Options
    Thanks for your reply. I followed the same steps. I got following error


    August 29th 2019 11:26:17
    Error
    Import-DatabaseBuildArtifact : The file or folder is not a valid build artifact:
    August 29th 2019 11:26:17
    Error
    'C:\Octopus\Applications\DatabaseAgainDeploy\Databases Test\MyPackage\1.0.21_1'

    I am getting error in create database release process, sharing the error and other configurations in attachment. 

    Thanks






     



  • Options
    uwmjeffuwmjeff Posts: 1 New member
    I have the exact same scenario and exact same problem.   The package produced by TeamCity doesn't seem to contain the Redgate items the Octopus step requires.
  • Options
    David_KeavenyDavid_Keaveny Posts: 3 New member
    I have this issue also; I am building my NuGet package via Atlassian BitBucket Pipelines, which does not have a purpose-built step for creating RedGate-friendly packages. Is there any documentation about what format BuildArtifact.json should take?
  • Options
    If someone else is experiencing this issue - open up the Nuget package and look at what's inside - in some cases TeamCity has produced empty Nuget packages - so when they get to Octopus and our plugin tries to deploy them it cannot do so and runs into this error.

    To fix this - make sure that TeamCity (or whatever build system you're using) is creating a Nuget package from the correct path (rather than an empty path)
    Andrew Pierce
    Technical Sales Engineer
    Redgate Software
Sign In or Register to comment.