cookbook 'flyway-cli', '= 0.5.0'
flyway-cli (7) Versions 0.5.0 Follow1
Installs and execute flyway cli
cookbook 'flyway-cli', '= 0.5.0', :supermarket
knife supermarket install flyway-cli
knife supermarket download flyway-cli
flyway-cli-cookbook
This cookbook configure the CLI version of the flyway tool, and support multiple databases.
Requirements
An already configured database, and a bunch of flyway migrations.
Usage
include_recipe "flyway-cli::default"
## put your migrations in node[:flyway][:migrations_path]
## run migrate
flyway_migrate
### (Optional) Setup the Encrypted Data Bag
Your data bag should look like this,
{
"id": "[YOUR_ID_DONT_EDIT]",
"jdbc_username": "USER",
"jdbc_password": "PASSWORD",
}
Attributes
node[:flyway][:version] = "2.1.1"
node[:flyway][:jdbc_driver][:postgresql][:version] = "9.3-1100-jdbc4"
node[:flyway][:jdbc_driver][:mysql][:version] = "5.1.28"
node[:flyway][:jdbc_driver][:jtds][:version] = "1.3.1"
# optional attributes to define the user/group for the properties files containing database login credentials. defaults to executing user.
node[:flyway][:user]
node[:flyway][:group]
# set the permissions for the properties files. defaults to '0640'
node[:flyway][:properties_permissions] = 0640
node[:flyway][:confs] = {
:default => {
:jdbc_url => "jdbc:postgresql://localhost:5432/database",
:jdbc_username => "username",
:jdbc_password => "password"
},
:default2 => {
:jdbc_url => "jdbc:jtds:sqlserver://localhost/database2",
# if a data bag is used, data bag name and item must be configured
:use_data_bag => true,
:data_bag_name => "data_bag",
:data_bag_item => "data_bag_item"
# optionally provide the path to the data bags secret file
:data_bag_secret_path => "/etc/chef/secret_file"
}
}
## Determines if the Opscode Java recipe is included
node[:flyway][:include_java_recipe] = true
Recipes
default
Download flyway, extract it in a folder, download jdbc driver for mysql, postgres and sql server, generate configs for the requested databases.
migrate - DEPRECATED
Use flyway_migrate
resource to launch migrations for every configured database.
Authors
Giovanni Toraldo @gionn
Manuel Mazzuola @manuelmazzuola
Dependent cookbooks
java ~> 1.17 |
windows ~> 1.38 |
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
Collaborator Number Metric
0.5.0 passed this metric
Foodcritic Metric
0.5.0 failed this metric
FC015: Consider converting definition to a Custom Resource: /tmp/571331eeeeafd9a5bda004f8/flyway-cli/definitions/flyway_migrate.rb:1
0.5.0 passed this metric
0.5.0 failed this metric
FC015: Consider converting definition to a Custom Resource: /tmp/571331eeeeafd9a5bda004f8/flyway-cli/definitions/flyway_migrate.rb:1