-
-
Save jacopen/1f7e2ad10636d088755b to your computer and use it in GitHub Desktop.
Gruntfile.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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