In this post we are going to create a project in Jenkins that drops all objects from a database to prepare it for a clean script deployment. In order to do this in Jenkins, we need the sql script that drops and recreate the database and the connection file. The good news are that Toad Edge can create these files for us. Let’s see how:
First let’s click on the CI/CD (Continuous Integration and Continuous Delivery) icon in the main toolbar
Then select Empty Database and enter the path to the toadedje.jar:
Warning: The toadedge-ctl.zip file can be downloaded from the portal:
Please make sure the path there is to this file!
Now let's continue.
Select the connection, the database and the output file name and click Next ( Note: the Output file will be created by Toad Edge…just enter the name there)
Here you can leave the data from default or change it. I just leave the one by default:
Toad Edge will create the correct files for us but, if you are curious, you can click on Code Preview to see the content of both files:
Click Finish and enter the password of the database if requested:
And this is all from toad's end! Wait…Are you new in Jenkins? Do not worry, I will also explain how to create the project in Jenkins.
Fist that all I would like to check we have set up properly the environment.
Go to Jenkins | Manage Jenkins |Configure System and make sure the Continuous Integration with Toad Edge libraries folder is filled in(is the same path we entered in Toad):
Then go to Jenkins | Manage Jenkins | Manage Plugins and ensure the Continuous Integration with Toad Edge Plugin is installed:
If something is missing please refer to the About Continuous Integration and Delivery in Toad Edge section on the User Guide.
Let's start creating the project. Go to the home page and select New Item
Then create a project:
go to the Build section and add a Deploy SQL Script build step
Now we need to provide the files Toad Edge created for us:
Then we just need to save the project and build it!
But first, let’s check our database. As you can see this database has just one table (it is easy to manage, it’s not? 🙂 )
After building the project, the database should be empty.Let's see if that is true!
Click on Build Now
Jenkins building….
and finished! Blue spot.That is a good signal!
And, what does the output say?
Success!!!
Let's double check by going to Toad Edge and selecting the database. Yes! Our database is ready for a clean script deployment!
Thanks for reading and hope that helps!
Start the discussion at forums.toadworld.com