MysqlDeploymentOnMachineGroup@1 - MySQL database deploy v1 task

Use this task to run your scripts and make changes to your MySQL Database. There are two ways to deploy: using a script file or writing the script in our inline editor.

Note

This is an early preview version. Since this task is server based, it appears on Deployment group jobs.

Syntax

# This task is supported on classic release pipelines only.
# Use the classic designer to add and configure this task in a classic release pipeline.
# See the following Inputs section for details on the inputs that this task supports.

Inputs

TaskNameSelector - Deploy MySql Using
string. Allowed values: SqlTaskFile (MySQL Script File), InlineSqlTask (Inline MySQL Script). Default value: SqlTaskFile.

Specifies either Script File or Inline Script.


SqlFile - MySQL Script
string. Required when TaskNameSelector = SqlTaskFile.

Specifies the full path of the script file on the automation agent or on a UNC path that is accessible to the automation agent, such as BudgetIT\DeployBuilds\script.sql. This string can also use predefined system variables, such as $(agent.releaseDirectory) and a file containing SQL statements.


SqlInline - Inline MySQL Script
string. Required when TaskNameSelector = InlineSqlTask.

Specifies the MySQL script to execute on the selected database.


ServerName - Host Name
string. Required. Default value: localhost.

Specifies the server name of Database for MySQL, such as localhost. This string is the same value that is used for Hostname in Parameters in MySQL Workbench.


DatabaseName - Database Name
string.

Specifies the name of the database. The script will create a database name if one does not already exist.


SqlUsername - MySQL User Name
string. Required.

This string is the same value that is used for Username in Parameters in MySQL Workbench.


SqlUsername - Mysql User Name
string. Required.

This string is the same value that is used for Username in Parameters in MySQL Workbench.


SqlPassword - Password
string. Required.

Specifies the password for MySQL Database. The password can be a variable defined in the pipeline, such as $(password), and may be marked as secret to secure it.


SqlAdditionalArguments - Additional Arguments
string.

Specifies the additional options that are supported by MySQL simple SQL shell. These options will be applied when executing the given file on the Database for MySQL.​

Example: You can change to the default tab separated output format, HTML format, or XML format. If you have problems due to insufficient memory for large result sets, use the --quick option.​


Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

None.

Remarks

Use this task to run your scripts and make changes to your MySQL Database. There are two ways to deploy, either using a script file or writing the script in our inline editor.

Note

This is an early preview version. Since this task is server-based, it appears on deployment group jobs.

Prerequisites

  • MySQL Client in agent box

The task expects MySQL client must be in agent box.

  • Windows Agent: Use this script file to install MySQL client
  • Linux Agent: Run command 'apt-get install mysql-client' to install MySQL client

Examples

This example creates a sample db in MySQL.

steps:
- task: MysqlDeploymentOnMachineGroup@1
  displayName: 'Deploy Using : InlineSqlTask'
  inputs:
    TaskNameSelector: InlineSqlTask
    SqlInline: |
      CREATE DATABASE IF NOT EXISTS alm;
      use alm;
    ServerName: localhost
    SqlUsername: root
    SqlPassword: P2ssw0rd

Requirements

Requirement Description
Pipeline types Classic release
Runs on Agent, DeploymentGroup
Demands None
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 1.100.0 or greater
Task category Deploy
Requirement Description
Pipeline types Preview, Classic release
Runs on DeploymentGroup
Demands None
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 1.100.0 or greater
Task category Deploy