View All Posts
read
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi
#GRUNT PLUGIN #JAVASCRIPT #LIQUIBASE #LOCAL DEVELOPMENT #NODE MODULE #NPM #PACKAGEJSON

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)[https://npmjs.org/package/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:

grunt.loadNpmTasks('grunt-liquibase');

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

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.

#GRUNT PLUGIN #JAVASCRIPT #LIQUIBASE #LOCAL DEVELOPMENT #NODE MODULE #NPM #PACKAGEJSON

Related Posts

Grunt and Liquibase - Exploring node.js and its associated tools, I've been intrigued by Grunt, dubbed as 'The JavaScript Task Runner'. Amid building a project, I wanted to integrate Liquibase - a useful database schema management tool we used in developing Vollow.me. Despite the lack of a Grunt plugin or a Node module for Liquibase, I've managed to get it operational with Grunt using grunt-shell. The next step is to package Liquibase into a formal Grunt task and streamline database settings loading.

Related Videos

AI Powered Raspberry Pi Home Automation - Is this the future? - Witness the power of ChatGPT controlling home automation lights through a Raspberry Pi, making life easier with plugins. Delve into the fascinating world of large language models, redefining interactions with APIs.
Live GPIO Viewer - In my latest discovery, I found an incredibly efficient visualization tool from the last outpost workshop that upgrades how I check the status of the GPIO pins on my ESP32. It's super simple to use and allows me to monitor pin activities directly. I set up a couple of LEDs and a button on various GPIO pins to demonstrate its effectiveness and the results were fantastic. Although it currently supports only digital input and output and PWM, I'm optimistic it will expand with time. Thanks to the open-source community, you can find the setup instructions in a GitHub repo. This tool is a revelation and I highly recommend it.
You Need Arduino GitHub Actions - Learn how to add GitHub badges to your Arduino projects, improving project visibility and attracting contributors. Set up automated build checks with GitHub Actions to prevent broken code merges.
Automating Blog Improvements with AI: Summaries, Tags, and Related Articles - Learn how to use ChatGPT to enhance your blog's homepage, create summaries and tags, find related articles, and generate post images with ease, leveraging AI to save valuable time and effort.
Moon Lamp - 3D Printing The Moon - Editing the model using Blender - Learn how to create a 3D printed glowing moon lamp by using a moon model from Thingiverse, preparing it with Blender, and printing with Cura. Follow the step-by-step process to prepare the model and set up the print settings to achieve the perfect moon lamp base. Stay tuned for the next video to prototype the hardware for lighting up your new lamp!
HELP SUPPORT MY WORK: If you're feeling flush then please stop by Patreon Or you can make a one off donation via ko-fi
Want to keep up to date with the latest posts and videos? Subscribe to the newsletter
Blog Logo

Chris Greening


Published

> Image

atomic14

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