🌈 ESP32-S3 Rainbow: ZX Spectrum Emulator Board! Get it on Crowd Supply →
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

I’ve been playing around with node.js quite a lot recently and learning about the tools ecosystem. One tool that seems to be getting a lot of attention recently is Grunt - which is billed as “The JavaScript Task Runner”. This seems to be the tool that people are suggesting should be used for automating node.js builds and other tasks.

In the little project that I’ve been playing around with I want to have a database. One of the things that we’ve found really useful developing Vollow.me has been liquibase. Liquibase has proved invaluable as we’ve made modifications and updates to our database schema and we’ve integrated it into our continuous build and deployment system.

This experience makes me want to integrate liquibase into my node project and to do that I think I need to get it working with grunt.

There currently isn’t a grunt plugin or a node module for calling liquibase - at some point I’ll probably get round to creating one - but for now I just want to get it up and running with grunt.

Reading through what plugins are available for grunt, the simplest integration I can see is to use grunt-shell to call out to liquibase jar and run my changelog file.

First off we need grunt-shell installed:

npm install --save-dev grunt-shell

And now we can create a Gruntfile with a task definition to call liquibase:

module.exports = function(grunt) {
	grunt.initConfig({
  		shell: {
	        liquibase: {
	            options: {
	                stdout: true,
	                stderr : true
	            },
	            command: 'java -jar liquibase.jar ' +
	                     '--changeLogFile changelog.xml '+
	                     '--username DB_USERNAME ' +
	                     '--password DB_PASSWORD ' +
	                     '--url jdbc:postgresql://DB_HOST:DB_PORT/DB_NAME ' +
	                     '--driver org.postgresql.Driver '+
	                     '--classpath postgresql-9.3-1100.jdbc41.jar ' +
	                     'update'
	   	    }
	   	}
	});
	grunt.loadNpmTasks('grunt-shell');
};

I’ve downloaded the liquibase.jar and postgresql jdbc driver already.

Now we can run grunt and apply our changeset to our database:

$ grunt shell:liquibase
Running "shell:liquibase" (shell) task
Liquibase Update Successful

Done, without errors.

Next step will be to try and package up liquibase in a proper grunt task. We should also probably be reading our database settings from somewhere as well (I’ve hard coded mine for now). But that’s a job for tomorrow…

Related Posts

Grunt Liquibase Plugin - After putting in some work, I've successfully figured out how to create a real grunt plugin. I've discovered that a node module is essentially a node application with a package.json, and with this understanding, setting up became simple. My new plugin can be found at the given link and has straightforward usage. Once installed, the plugin may be activated in your Gruntfile. The plugin's full mechanisms can be found at the mentioned link or at the git project page.

Related Videos

Surprisingly not CR*P - Vibing hardware - Well folks, what an adventure! After vibe coding our vibing button, I took up the challenge to vibe code the actual hardware for an ESP32 S3 dev board. Used a tool called at pile and gave it a whirl with some AI help from Claude. Interestingly, it handled everything from sourcing components with LCSC part numbers to wiring them up. Had a wee hiccup with missing capacitor in the RC circuit, but overall it was a thrilling ride watching the AI process! A bit of tweaking here and there, and we're good to go! Can't wait to see it in action.
ESP-IDF 6 Setup in VS Code: Blink & Debug an ESP32-S3 - Time to get with the program and jump to ESP-IDF v6.0.1 in VS Code. I show you how to install the prerequisites (I’m on a Mac with Homebrew), run the ESP-IDF Installation Manager, spin up a Blink example for an ESP32-S3, tweak menuconfig (GPIO21, 500 ms), then build and flash—switching from stubborn USB JTAG to trusty UART when things fail. We check the monitor, bump CPU to 240 MHz, fix flash to 16 MB, peek at PSRAM, and give PCBWay a quick shout-out.
Easy - KiCad Symbol, Footprint and 3D Model! - In this video, I walk you through the transition from EasyEDA to KiCad for your PCB designs. While we lose the tight integration with LCSC parts, we gain the ability to export 3D models in KiCad. I discuss the challenges of finding certain components and how a handy script can help pull LCSC components into KiCad. We also explore how to position and adjust components correctly. Needing enclosures for your design? We discuss how to export these 3D models for review and even import them into Fusion360. To top it off, I mention the value in using PCBWay for your PCB needs, including 3D printing and CNC work. It's a whirlwind of information, aimed to help you navigate and enhance your PCB design workflow.
This really SUCKS.... and I love it! - Exciting news! Robin sent me a Pixel Pump to try out, and I'm loving it so far. It's really well packaged and comes with a ton of handy goodies, including two foot pedals and SMD magazines. It's perfect for my USB tester project as it makes pick and placing components super easy. Although it requires a bit of practice, the foot pedals make the process much smoother. Plus, with the interactive BOM plugin for KiCad, I can mark components as placed without using a keyboard!
How Good Are My USB Cables? - In this video, I engage in a deeper exploration of USB testing, encountering a range of trials and tribulations along the way. First up, I attempt to test a couple of USB cables and discuss their data lines' peculiar situatedness. Then, I delve into the assembly of the PCB boards, sourced from PCBWay, which surely turned into a learning voyage than an easy sail. The first version faced challenges of misordered large-frame stencil, unseen connection problems, and even DRC errors in the submission process. Not dwell on that, I redesign and bring to table Version 2, complete with USB connectors with broken-out pins and designed for visual inspection ease. Although this version demonstrated success, soldering difficulties and bad connections persisted. Considering all the hurdles, I decide to let PCBWay handle the assembly for the next version. For future strategies, adding test points and eliminating the lithium-ion charging circuit seemed more practically viable. Peeping into version 3, testing points for all USB cable pins have been added and even an option to break out actual USB connections, all towards ensuring an improved error checking and usefulness of the assembly.
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