Running Flyway jobs
To run the Flyway job for the first time, follow these steps:
- From the folder of your App Factory project, navigate to Database → Flyway.
- Select the Flyway job, and then select Build with parameters option from the menu on the left side.
Alternatively, you can run the build with parameters by following either of these steps.
- On the right-side of the job row, select the icon that represents Build with Parameters
- Open the drop-down list (context-menu) for the Flyway job, and then select Build with Parameters
NOTE: If you do not see the option, you might not have ownership permissions to the project. You can verify whether your name is listed in the Folder Owners section of the project. The Primary owner of the project can add users as secondary owners to grant permissions to the builds.
- On the right-side of the job row, select the icon that represents Build with Parameters
- Configure the build parameters for the job. For more information about the parameters, refer to the following sections.Source Control related parameters
Parameter Description SCM_URL
Specifies the URL of the source control repository that contains the Flyway scripts. The URL can be an HTTPS URL or an SSH URL and must be accessible by App Factory.
The format for an HTTPS URL is
https://git-vendor.com/username/reponame.git
The format for SSH URL is
git@git-vendor.com:username/reponame.git
Typically, a repository URL can be found by clicking a Code or Clone button.
IMPORTANT:If you are using Azure DevOps as your Git vendor, the format of the Repository URL must adhere to the following syntax.
- HTTPS URL syntax:
https://dev.azure.com/organization-name/project-name/_git/repo-name
- SSH URL syntax:
git@ssh.dev.azure.com:v3/organization-name/project-name/repo-name
SCM_BRANCH
Specifies the branch of the source control repository that contains the specific version of the Flyway scripts that you want to use.
SCM_CREDENTIALS
Specifies the credentials that are used to access the source control repository.
For more information, refer to Adding New Source Code Repository Credentials.
Flyway related parametersParameter Description MIGRATION_TYPE Specifies the type of migration in the Flyway job. Based on the selection, refer to either of the following tables:
DB_CREDENTIALS
Specifies the credentials that are used to access the database and run the Flyway scripts.
For more information, refer to Adding New Database Credentials.
Parameter Description LOCATION
Specifies a comma-separated list of paths that contain the Flyway scripts, relative to the root of the source control repository.
FLYWAY_COMMAND
Specifies the commands that are run as part of the Flyway job. For example:
migrate
,info
, orvalidate
For more information, refer to Commands in the Flyway documentation.
DB_CREDENTIALS
Specifies the credentials that are used to access the database and run the Flyway scripts.
For more information, refer to Adding New Database Credentials.
OPTIONS
Specifies command line options that are used with the Flyway command. For example:
-schemas=dbpdblocal
For more information, refer to Command-line in the Flyway documentation.
Parameter Description MVN_GOALS_AND_OPTIONS
Specifies the Maven goals and other command line options for the mvn command.
JAR_ARGUMENTS
Specifies the list of mandatory arguments (as a string; separated by spaces) that are passed to the JAR file. For example :
-Ddb.name=dbxdb
NOTE: Database user, password, host, port, and type will be fetched automatically from the fields provided inside DB_CREDENTIALS.
MVN_PROJECT_LOCATION
Specifies the location of the Maven POM file(excluding the name
pom.xml
). The path is relative to the root level of the repository. For example: If the root of the repository contains two directories,dir1
anddir2
, andpom.xml
is situated in thejava
folder insidedir1
, then the path isdir1/java/
.JAR_LOCATION
Specifies the path to the JAR file(including the name of the JAR). For example: If the root of the repository contains two directories,
dir1
anddir2
, andexample.jar
is situated in thejavaTarget
folder insidedir1
, then the path isdir1/javaTarget/example.jar
.Notification related parametersParameter Description RECIPIENTS_LIST
Specifies a comma-separated list of the e-mail addresses that must receive notifications on the results of this job.
- HTTPS URL syntax:
- After you configure all the parameters, click BUILD.
After a Build is successfully triggered, you can check the status of the build in the Build History panel. The following screenshot displays a build that is in progress (#4965) with the progress indicator icon.
You can click the icon to see the detailed output of the current build or click the progress bar to open the build page of the job. From the build page, you can click Console Output to display the detailed output of the running build.