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
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.
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.
Arduino Badges: Improve Your Project's Visibility and Health with 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!
ESP32 HTTP Web Server With Content Served from SPIFFS Filesystem - Learn how to create a simple ESP32 web server and user interface using basic HTML and JavaScript, and control an LED via an HTTP endpoint. This tutorial demonstrates the ease of setting up a web server on ESP32 devices and serving compressed content from SPIFFS.
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