Options

How to delpoy with Bamboo and DLM Automation

I cannot seem to find an easy way to deploy a build I created in Bamboo. First, I created a database build, using my local copy of the git RedGate code that is used to link up to my database for syncing. That build works great in Bamboo, but now I want to deploy it onto an actual server. What is the easiest way to do this? Whenever I try to build a deployment, I get the error "You can not deploy to TEST. You have not yet configured the tasks". However, the tasks I am wanting to configure is the same as the Build task, i.e. the DLM Automation Build. I just want it to build the database on either to local or remote SQL Server. What am I missing here?

Answers

  • Options
    AlexYatesAlexYates Posts: 264 Rose Gold 2
    You need to save the package that you created in your build plan as an artifact.

    Then you need to create a deployment plan to deploy the package to the other environments.

    I can't find a SQL Server or plug-in walk through - but I wrote this blog post (first of a 2 parter) which talks you through a similar process for Oracle databases using command lines and powershell scripts etc.

    The Bamboo bits are mostly the same.

    http://workingwithdevs.com/continuous-delivery-oracle-databases-bamboo-redgate-1/
    Alex Yates
    DevOps Mentor and Coach

    Director of DLM Consultants
    Creator of Speaking Mentors
    Microsoft Data Platform MVP
    Friend of Redgate
    Twitter / LinkedIn
  • Options
    TimothyCloudTimothyCloud Posts: 6 New member
    I feel like I'm so close, but somehow I'm missing something. For example, do I need to download and install NuGet in order for Bamboo to create the NuGet artifact? Once the Artifact is created, are you saying I need to run a PowerShell script to actually deploy the database? If I can just get the deployment part to work, that will be most of the battle. Then I want to go back and add a bunch of testing in whenever a change is submitted in source control. Any additional help is GREATLY appreciated.
  • Options
    AlexYatesAlexYates Posts: 264 Rose Gold 2
    edited January 5, 2018 9:32AM
    This might require a longer conversation to explain the process. Feel free to start a private thread on Twitter/Linkedin etc and we can set up a quick 10 min call etc.

    In brief:

    What do you want to achieve?

    IF (Build once, deploy immediately to test only){
    As part of your build process add a step to SYNC the code to your test DB and ignore the deployment
    functionality of Bamboo.
    This is the simpler JFDI approach.
    }
    ELSE IF (Build once, deploy to multiple environments on demand at the click of a button){
    Publish your NuGet package (gets created by DLM Automation, you don't need a separate NuGet install)
    Use the release management functionality in Bamboo by setting your deployment steps.
    These deployment steps will use either RG plugin or PowerShell to deploy your NuGet packages.
    This is the more mature, configurable and scalable approach.
    }
    ELSE {
    Please explain exactly what you want to achieve in a bit more detail.
    }

    I hope that helps.
    Alex Yates
    DevOps Mentor and Coach

    Director of DLM Consultants
    Creator of Speaking Mentors
    Microsoft Data Platform MVP
    Friend of Redgate
    Twitter / LinkedIn
  • Options
    AlexYatesAlexYates Posts: 264 Rose Gold 2
    Grrr. bbcode does not seem to handle my whitespace very well. :-(
    Alex Yates
    DevOps Mentor and Coach

    Director of DLM Consultants
    Creator of Speaking Mentors
    Microsoft Data Platform MVP
    Friend of Redgate
    Twitter / LinkedIn
  • Options
    TimothyCloudTimothyCloud Posts: 6 New member
    So right now, I'm just trying to achieve a proof of concept mainly.
    I have a database, actually several of them, that I am attempting to get Bamboo to Build, Test, Deploy into another SQL Server environment. I get the build process done...not as concerned about TEST yet, but I need the results of that build (which I store locally as a NuGet package) to now deploy on another SQL Server that is not local to the Bamboo server. Isn't there a way I can do that using the Command Line or Powershell or similar method? That's my next step. Build--<maybe test>--Deploy then I will come back and start working on putting something like that to work in a real task, such as...developer creates new stored proc and puts it into SQL Source Control....trigger is fired to automate the Bamboo Build and Test and Deploy into PreProd....and then I'll really need some help I would imagine. :)
  • Options
    Am I looking for SQL Compare along with DLM Automation using Bamboo for my scenario?
  • Options
    AlexYatesAlexYates Posts: 264 Rose Gold 2
    1. Install a Bamboo agent somewhere that can talk to the target DB. You might need multiple agents to get to all your target DBs.
    2. Install Redgate DLM Automation on the target agents.
    3. Your deployment steps will: Copy Nuget to target agent, run DLM Automation to deploy NuGet to target DB.

    Let me know if you'd like to schedule a call to discuss in more detail.

    Alternatively this is all covered on a DLM Workshop we are running later this month (EU timezone):
    http://dlmconsultants.com/dlm-workshops/#schedule

    (On day 2 we'll cover the DLM Automation build/test functionality and we'll automate it with TeamCity. On day 3 we'll look at SQL Server Release Management using Octo Deploy. However, the principles of both days will apply to Bamboo too.)
    Alex Yates
    DevOps Mentor and Coach

    Director of DLM Consultants
    Creator of Speaking Mentors
    Microsoft Data Platform MVP
    Friend of Redgate
    Twitter / LinkedIn
  • Options
    Ok, I will mention classes to the customer, however they have a new hire DBA onboarding in early February, so would love to know your schedule for around that time and and deals we could get on 3-4 seats for the DLM Automation Continuous Integration stuff. The only tool we have committed to is Redgate. So, using Bamboo, Octopus, Jenkins, Whatever is all an option if a solid case can be made for ROI of such tools for their particular company. Let me tell you a little about what I have done so far:
    1.) On 1 server, I have manually deployed all their databases using a repository and SQL Source control.
    2.) I have been given another server instance of SQL to try and "deploy" to as a target.
    3.) On my 1 server, I installed RedGate DLM Automation, Bamboo, Octopus and considering Team City.\
    4.) On my target server, I don't have access beyond SQL Server, and I need to know if that is my next request from the customer?

    What we are attempting is to have an automated Build of the database stored in Redgate Source Control onto a server which has never ran anything other than SQL Server. Is that even possible?

    Thanks!
  • Options
    AlexYatesAlexYates Posts: 264 Rose Gold 2
    edited January 10, 2018 3:12PM
    I think this conversation moving to a place not best suited to a Redgate forum thread. If you'd like to discuss a training or consulting engagement please can you email us. You can find the email address on our website:
    dlmconsultants.com

    However, to answer the technical question:

    The question is can you talk to SQL Server from server 1. If you can connect to it via SSMS/SQL Compare etc then you can run all the DLM Automation build and deployment processes from that machine and do not need to install anything on target server.

    However, if server1 cannot talk to target server you will need to install the TeamCity/Bamboo/Octopus agent somewhere that can talk to target server. Installing it actually on target server is an option but any server that has access to target server should be sufficient.

    (And install DLM Automation on whatever machine you install the agent on.)
    Alex Yates
    DevOps Mentor and Coach

    Director of DLM Consultants
    Creator of Speaking Mentors
    Microsoft Data Platform MVP
    Friend of Redgate
    Twitter / LinkedIn
  • Options
    Excellent news. Thanks Alex. I am getting some results using PowerShell scripts to deploy the NuGet package that Bamboo and Redgate DLM create, so I think I'm getting close. I'll also be in touch concerning further training.
  • Options
    AlexYatesAlexYates Posts: 264 Rose Gold 2
    Well done Tim. Keep it up. :-)
    Alex Yates
    DevOps Mentor and Coach

    Director of DLM Consultants
    Creator of Speaking Mentors
    Microsoft Data Platform MVP
    Friend of Redgate
    Twitter / LinkedIn
Sign In or Register to comment.