You can override the build step of a part. So a simple example would be:
parts:
your-complex-part:
...
override-build: |
sudo npm i -g hogan.js
hulk ./web/mustache/*.html --outputdir ./web/templates/
snapcraftctl build
...
The above will run your commands, then run what would norin the override.mally be run in a build via snapcraftctl build
You can also break that out into a separate part, with its own build step, for organization purposes (and to avoid manually calling snapcraftctl build).
Note: don’t forget the pipe after the colon in override-build. That’s yaml for “include the below text as a blob of text”. If you leave it out, you’ll wind up with invalid yaml.
I’d like to use multiple parts since there’s multiple build steps in multiple languages. I also saw that we could use plugins, like a Go plugin and a NodeJS plugin, and I’d like to use those if possible
In the NodeJS plugin, I’m trying to have it install my dependency without having to use sudo npm install -g so it’s cleaner and doesn’t modify the system in unexpected ways, but there’s something wrong with my part.
Failed to load plugin: properties failed to load for hulk: ‘source’ is a required property
What should I use for the source? There’s nothing about a source in the docs.
Also, when I add node-package-manager: npm, I get an error.
Failed to load plugin: properties failed to load for hulk: Additional properties are not allowed (‘node-package-manager’, ‘node-packages’, ‘npm-run’, ‘node-engine’ were unexpected)