Skip to content

Instantly share code, notes, and snippets.

@jacopen

jacopen/js

Created Dec 15, 2015
Embed
What would you like to do?
Gruntfile.js
module.exports = function(grunt) {
var moment = require('moment');
var repo_dir = "/home/jacopen/Project/node_modules/node-red/config"
var files = ["king_cred.json", "king.json"]
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch: {
flow: {
files: 'config/*.json',
tasks: ['gitcommit:task']
},
master: {
files: 'version',
tasks: ['gitcheckout:master', 'gitmerge:task', 'gittag:task', 'gitcheckout:develop']
}
},
gitcommit: {
task:{
options: {
cwd: repo_dir,
message: moment().format(),
},
files: {
src: files,
cwd: repo_dir
}
}
},
gitcheckout: {
master: {
options: {
cwd: repo_dir,
branch: "master"
}
},
develop: {
options: {
cwd: repo_dir,
branch: "develop"
}
}
},
gitmerge: {
task: {
options: {
cwd: repo_dir,
branch: "develop"
}
}
},
gittag: {
task: {
options: {
cwd: repo_dir,
tag: grunt.file.read('version').replace(/\n/, '')
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-git');
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment