View All Posts

After my work yesterday I sat down and worked out how to create a proper grunt plugin. Once I realised that a node module is purely a node application with a package.json this proved to be really simple. One thing that is really great is learning the npm is not just for pulling down packages from the repository but is also great for local development.

I also borrowed quite a bit from (grunt-shell)[] to work out the best way to call the child process to run liquibase.

You can find my new grunt plugin here: grunt-liquibase

Usage is pretty straightforward:

npm install grunt-liquibase --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:


And add a section named liquibase to the data object passed into grunt.initConfig().

	liquibase : {
		update: {
			options: {
				username : 'DB_USERNAME',
				password : 'DB_PASSWORD',
				url : 'jdbc:postgresql://DB_HOST:DB_PORT/DB_NAME'
			command: 'update'
		version : {
			command: 'version'

You can now run grunt liquibase:update and your database will be updated!

Full detail of the plugin can be found here: grunt-liquibase or at the git project page here.

Blog Logo

Chris Greening


> Image


A collection of slightly mad projects, instructive/educational videos, and generally interesting stuff. Building projects around the Arduino and ESP32 platforms - we'll be exploring AI, Computer Vision, Audio, 3D Printing - it may get a bit eclectic...

View All Posts