Versions:3.0+
The command line API for QuerySurge is deprecated. We do recommend switching existing API calls to the REST API. Information on our REST API can be found here
QuerySurge and Build Automation / Continuous Integration
Data Warehouse/Big Data teams often use Build Automation and/or Continuous Integration tools as part of their development and build processes. Frequently, as teams mature in their development processes, there is interest in including data testing and/or data verification in the automated build process. QuerySurge offers a command-line based Base API, which provides an easy integration for any Automated Build or Continuous Integration tool.
Build Automation with Bamboo and QuerySurge Testing
Integrating QuerySurge into a new or previously created build in Bamboo is generally a straightforward task, which is done by calling into the QuerySurge Base API from Bamboo. The simplest way to add calls to the QuerySurge Base API from Bamboo is by setting up a .bat or .sh file that contains the QuerySurge API calls, and launching the .bat or .sh file from Bamboo on a schedule of your choice. In this article, we describe how to set this up for deployments of the QuerySurge Base API on Windows. (This article is based on Bamboo 5.14.4.1; steps may differ slightly for other versions.)
Pre-requisite: Create a Script to Schedule
You'll need a set of QuerySurge command-line Base API calls specifying what you want to execute on your schedule - an API script of the Base steps. When you install the Base API, the installation directory will contain sample batch scripts. You can use these sample batch files to see how to write your own scripts. In this article, file_name.bat
and file_name.sh
refer to API scripts that you have written to execute QuerySurge.
Create A New Plan
Bamboo uses plans to collect build all of the settings and steps related to particular builds. In this example, we'll create a sample plan to run and execute our batch file.
- Click Create from the top ribbon and then choose Create a new plan from the dropdown.
- In the popup window, fill in the fields as appropriate. In the Project field, select New Project. In the Project Name and Plan Name fields, fill in names of your choice.
- If you wish to link your new build plan to a repository, select the desired repository from the Repository Host field. If you do not wish to link your new build plan to a repository, simply select None.
Configure your Tasks
Upon creating a new plan, you should be brought to a Configure tasks panel that shows No tasks configured.
- Click the Add Task button in the center of this panel.
- A Task types window should have popped up. Scroll down until you see an option called Script. Select this option.
- If you are working with a file inside your build working directory, enter one of following commands in the Script body (the former may cause the Bamboo build to hang on some systems):
${bamboo.build.working.directory}\file_name.bat
or:start /d "${bamboo.build.working.directory}" file_name.bat
Otherwise, use one of these commands:
<Absolute Path to file folder>\file_name.bat
or:start /d "<Absolute Path to file folder>" file_name.bat
- Click Save. Towards the bottom of the page is an option: Enable this plan? Make sure that the Yes, please! checkbox underneath this option is checked. Then, click the Create button all the way at the bottom. The task should have been successfully created.
Running the Plan
After following the above steps, you should now be on the Plan page. On the upper right, you should see a drop down called Run. Click this button and then select Run plan from the drop down menu. Assuming everything has been configured correctly, the run should execute.
Comments
0 comments
Article is closed for comments.