cookbook 'flywaydb', '= 3.0.1'
flywaydb
(30) Versions
3.0.1
-
Follow3
Installs and configures flywaydb database migration tool
cookbook 'flywaydb', '= 3.0.1', :supermarket
knife supermarket install flywaydb
knife supermarket download flywaydb
Flywaydb Cookbook
Installs flywaydb and allows for execution of flyway commands via resource actions.
Requirements
- Chef 11+
Platforms
- CentOS/RedHat
- Debian/Ubuntu
- Windows
Usage
Include default recipe in cookbook or run list to install flywaydb.
Attributes
-
node['flywaydb']['version']
- The flywaydb version to install. Default3.2.1
. -
node['flywaydb']['sha256']
- The flywaydb SHA 256 checksum for linux or windows platform. -
node['flywaydb']['install_dir']
- The base install directory. Default linux:/opt/flyway
windows:C:\flyway
. -
node['flywaydb']['user']
- The owner of flywaydb. Defaultflyway
. -
node['flywaydb']['group']
- The group of flywaydb. Defaultflyway
.
Resources
Use migrate, info, validate, baseline, or repair actions to install flywaydb and execute associated flyway command.
Attributes
-
conf
A hash or array of hashes used to create the default Configuration file(s) for the flyway conf file. Key values automatically get prefixed with flyway. This attribute will be ignored ifext_conf
is set. Default:nil
. -
ext_conf
- Path or array of paths to external Configuration file(s). Theconf
attribute will be ignored if this is set. Default:nil
. -
params
- A hash of command-line parameters to pass to flyway command. Command-line parameters override Configuration files. Default:{}
. -
name
- The name of the flyway conf file. Defaults to resource name. -
debug
- Print debug output during execution of flyway commands. Default:false
. -
sensitive
- Ensure that sensitive resource data is not logged by the chef-client. Default:true
.
Examples
Single flyway conf migration
flywaydb 'myapp' do conf( url: 'jdbc:mysql/localhost/mydb', user: 'root', locations: 'filesystem:/opt/myapp/db/migration' ) action :migrate end
Multiple flyway conf migrations with command-line parameters
flywaydb 'myapp' do params( user: 'root', password: password, url: 'jdbc:mysql/localhost/mysql' ) conf( { schemas: 'custA', locations: 'filesystem:/opt/myapp/db/migration/core,/opt/myapp/db/migration/custA' }, { schemas: 'custB', locations: 'filesystem:/opt/myapp/db/migration/core,/opt/myapp/db/migration/custB' } ) action :migrate end
Multiple flyway ext_conf migrations with command-line parameters
flywaydb 'myapp' do params( user: 'root', password: password, url: 'jdbc:mysql/localhost/mysql' ) ext_conf( '/opt/myapp/custA.properties', '/opt/myapp/custB.properties' ) action :migrate end
ChefSpec Matchers
This cookbook includes custom ChefSpec matchers you can use to test
your own cookbooks.
Example Matcher Usage
expect(chef_run).to migrate_flywaydb('flyway').with( params: { 'user' => 'root', 'password' => 'password', 'url' => 'jdbc:mysql://localhost/mysql' } conf: [ { 'schemas' => 'custA', 'locations' => 'filesystem:/opt/myapp/db/migration/core,/opt/myapp/db/migration/custA' }, { 'schemas' => 'custB', 'locations' => 'filesystem:/opt/myapp/db/migration/core,/opt/myapp/db/migration/custB' } ], debug: false, sensitive: true )
Cookbook Matchers
- migrate_flywaydb(resource_name)
- clean_flywaydb(resource_name)
- baseline_flywaydb(resource_name)
- info_flywaydb(resource_name)
- repair_flywaydb(resource_name)
- validate_flywaydb(resource_name)
Getting Help
- Ask specific questions on Stack Overflow.
- Report bugs and discuss potential features in Github issues.
Contributing
Please refer to CONTRIBUTING.
License
MIT - see the accompanying LICENSE file for details.
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
There are no cookbooks that are contingent upon this one.
CHANGELOG
3.0.1 2016-02-08
- Fix sensitive not defaulting to true
- Fix clean action
3.0.0 2016-02-20
- Remove global attributes ext_conf, conf, params, sensitive, and debug
- Default sensitive to true
2.0.0 2016-02-10
- Remove command recipes
1.0.0 2016-02-04
- Initial release
Foodcritic Metric
3.0.1 passed this metric
3.0.1 passed this metric