This article explains how to add an SQL task and execute the single to execute sql scripts from a file using the app, SQL for Bamboo on Server.
Instructions
- Log in as a Bamboo administrator.Navigate to > Add-ons > Find new apps and search for "SQL for Bamboo". Ensure you have SQL for Bamboo app installed in your Bamboo instanceAdministrator.
- Ensure you have a project and a plan with respective stages and jobs configured. We shall use Project = Demo and Plan = Demo_plan in the below example:
- Click on a job. In the example below, Demo_job2 > Add task > select SQL task
Provide all the details like description, Script location, Script, and database profile and click on Save as shown:
- Below is the resultant persons.sql file:
Now, click on Run plan for the SQL task to get executed.
The output will result in the table creation in the database.
Note - Ensure you have SQL for Bamboo app installed in your Bamboo instance.
- If Script location is File, make sure to place the .sql file in that particular project with plan and job configured and directory, <BambooHome>/xml-data/builds-dir/project-plan-job>