Release NPM package with git-flow

Having an NPM package in an enterprise environment and wanting to release that package using the git-flow model? Then using the node-generate-release can be very helpful.
This blog shows how to execute an integrated git flow release from your NPM package, even if your master and develop branches are protected.

Install plugin

Let’s assume we have all changes in the develop branch and we would like to create a release with all the current changes in develop. With the git-flow release the result will be that all changes will be merged into master and a tag for the release version is created with correct version. Before we can finish the release the correct version in NPM package.json needs to be set. This can all be nicely done with node-generate-release plugin.

Continue reading

Make Git files executable

You can check files with correct permissions into Git to be able to run them on the continuous integration server right after checkout. Setting the right properties in the git-index will force Git to checkout the file and set the right file permissions.

Set the core.fileMode in the git configuration to false. The means: Do not ignore the file mode.
Then update the git-index with –chmod for your file, commit and push the file to the repository.

See: git-update-index

Gradle Goodness: Use Git Commit Id in Build Script

The nice thing about Gradle is that we can use Java libraries in our build script. This way we can add extra functionality to our build script in an easy way. We must use the classpath dependency configuration for our build script to include the library. For example we can include the library Grgit, which provides an easy way to interact with Git from Java or Groovy code. This library is also the basis for the Gradle Git plugin.

Continue reading

Grails Goodness: Generate Default .gitignore Or .hgignore File

We can use the integrateWith command with Grails to generate for example IDE project files and build system files. We specify via an extra argument the type of files to be generated. We can use this command also to create a .gitignore file with some default settings for files to be ignored in Grails projects.

Continue reading

Groovy Goodness: Using Groovy for Git Hooks

Git supports hooks, which are scripts that are fired when certain events happens. The scripts are simply shell scripts and we can use Groovy to run those scripts. We must make Groovy the script language with the hash-bang (#!) header in the Git hook script file. And then we are ready to go and use Groovy as the script language for the Git hooks.

Continue reading