Redgate Flyway

Common migrations-based deployment scripts

Full automated deployment when the build and target environments are configured in toml

# Run code analysis on migrations (optional)
flyway check -code "-code.failOnError=true"

# Check to see if the target environment has drifted since last deployment (optional)
flyway check -drift -buildEnvironment="build" -environment="production" -failOnDrift=true

# Generate a deployment report, containing list of objects changes (optional)
flyway check -changes -buildEnvironment="build" -environment="production"

# Execute pending migrations against the target environment, baselining if this is the first deployment
flyway migrate -baselineOnMigrate=true -environment="production"

This script runs code analysis, runs drift analysis, and generates a deployment report, ahead of deployment. It uses the check code, check drift, check changes, and migrate commands.

Full automated deployment when the build and target environments are configured inline

# Run code analysis on migrations (optional)
flyway check -code "-code.failOnError=true" 

# Check to see if the target environment has drifted since last deployment (optional)
flyway check -drift -buildEnvironment=build "-environments.build.url=<JDBC URL>" "-url=<JDBC URL>" -failOnDrift=true 

# Generate a deployment report, containing list of objects changes (optional)
flyway check -changes -buildEnvironment=build "-environments.build.url=<JDBC URL>" "-url=<JDBC URL>"

# Execute pending migrations against the target environment, baselining if this is the first deployment
flyway migrate -baselineOnMigrate=true "-url=<JDBC URL>"

This script runs code analysis, runs drift analysis, and generates a deployment report, ahead of deployment. It uses the check code, check drift, check changes, and migrate commands.


Didn't find what you were looking for?