Commit bc7c3599 authored by echel0n's avatar echel0n

Updated gruntfile.

parent ecc4ad7c
......@@ -48,17 +48,6 @@ module.exports = function (grunt) {
'pypi_upload': {cmd: 'twine upload dist/*'},
'pypi_cleanup': {cmd: 'python setup.py clean'},
// Docker Commands
'build_docker_image': {
cmd: 'docker build --build-arg SOURCE_COMMIT=' + shell.exec("git rev-parse HEAD", {'silent': true}) + ' -t sickrage/sickrage:py3-alpha .'
},
'push_docker_image': {
cmd: [
'docker login -u ' + process.env.DOCKER_REGISTRY_USERNAME + ' -p ' + process.env.DOCKER_REGISTRY_PASSWORD,
'docker push sickrage/sickrage:py3-alpha',
].join('&&')
},
// Git Commands
'git': {
cmd: function (cmd, branch) {
......@@ -88,6 +77,15 @@ module.exports = function (grunt) {
grunt.log.write(stderr);
}
},
'git_merge': {
cmd: function (branch) {
return 'git merge --no-ff ' + branch;
},
stderr: false,
callback: function (err, stdout, stderr) {
grunt.log.write(stderr);
}
},
'git_last_tag': {
cmd: 'git for-each-ref refs/tags --sort=-taggerdate --count=1 --format=%(refname:short)',
stdout: false,
......@@ -117,51 +115,10 @@ module.exports = function (grunt) {
}
},
'git_tag': {
cmd: function (sign) {
sign = sign !== "true" ? '' : '-s ';
return 'git tag ' + sign + grunt.config('new_version') + ' -m "' + grunt.config('commits') + '"';
},
stdout: false
},
'git_flow_bugfix_start': {
cmd: function (version) {
return 'git flow bugfix start ' + version;
},
stderr: false,
maxBuffer: 500 * 1024,
callback: function (err, stdout, stderr) {
grunt.log.write(stderr);
}
},
'git_flow_bugfix_finish': {
cmd: function (version, message) {
return 'git flow bugfix finish ' + version;
},
stderr: false,
maxBuffer: 500 * 1024,
callback: function (err, stdout, stderr) {
grunt.log.write(stderr);
}
},
'git_flow_release_start': {
cmd: function (version) {
return 'git flow release start ' + version;
},
stderr: false,
maxBuffer: 500 * 1024,
callback: function (err, stdout, stderr) {
grunt.log.write(stderr);
}
},
'git_flow_release_finish': {
cmd: function (version, message) {
return 'git flow release finish ' + version + ' -m "' + message + '"';
return 'git tag ' + version + ' -m "' + grunt.config('commits') + '"';
},
stderr: false,
maxBuffer: 500 * 1024,
callback: function (err, stdout, stderr) {
grunt.log.write(stderr);
}
stdout: false
}
}
});
......@@ -211,7 +168,7 @@ module.exports = function (grunt) {
}
});
grunt.registerTask('bump_version_file', function (new_version) {
grunt.registerTask('bump_version', function (new_version) {
const vFile = 'sickrage/version.txt';
grunt.file.write(vFile, new_version)
});
......@@ -246,7 +203,7 @@ module.exports = function (grunt) {
'changelog',
'webpack:dev',
//'sync_trans',
'bump_version_file:' + newVersion,
'bump_version:' + newVersion,
'exec:git_commit:Pre-Release v' + newVersion,
'exec:git_push:origin:develop',
'exec:pypi_create',
......@@ -285,13 +242,14 @@ module.exports = function (grunt) {
const newVersion = vArray.vMajor + '.' + vArray.vMinor + '.' + vArray.vPatch;
const tasks = [
'exec:git_flow_release_start:' + newVersion,
'changelog',
'webpack:prod',
//'sync_trans',
'bump_version_file:' + newVersion,
'bump_version:' + newVersion,
'exec:git_commit:Release v' + newVersion,
'exec:git_flow_release_finish:' + newVersion + ':Release v' + newVersion,
'exec:git_last_tag', 'exec:git_list_changes', 'exec:git_tag:' + newVersion,
'exec:git:checkout:master',
'exec:git_merge:develop',
'exec:git_push:origin:develop',
'exec:git_push:origin:master:tags',
'exec:pypi_create',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment