Skip to content

Commit

Permalink
Merge pull request #158 from Wisembly/imp-release-it
Browse files Browse the repository at this point in the history
Release it | Imps
  • Loading branch information
Ugo Onali committed Oct 12, 2015
2 parents ddb4374 + 0a59be7 commit 54e205f
Show file tree
Hide file tree
Showing 11 changed files with 120 additions and 78 deletions.
8 changes: 8 additions & 0 deletions release-it/assets/add.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var exec = require('../tools/exec');

module.exports = function (cb) {
exec('git add -f dist/', function (err, data) {
if (err) return false;
return cb(null);
});
};
36 changes: 36 additions & 0 deletions release-it/assets/check.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
var async = require('async');
var exec = require('../tools/exec');
var log = require('../tools/log');
var opts = require('../opts');

module.exports = function (cb) {
async.waterfall([
function (_cb) {
exec('ls dist/css/', function (err, data) {
return err ? log('✗ Styles failed') : _cb(null);
});
},

function (_cb) {
exec('ls dist/stats/', function (err, data) {
return err ? log('✗ Stats failed') : _cb(null);
});
},

function (_cb) {
exec('ls dist/js/', function (err, data) {
return err ? log('✗ Scripts failed') : _cb(null);
});
},

function (_cb) {
exec('ls dist/fonts', function (err, data) {
return err ? log('✗ Icons failed') : _cb(null);
});
},

function (_cb) {
cb(null)
},
]);
};
40 changes: 40 additions & 0 deletions release-it/assets/generate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
var async = require('async');
var exec = require('../tools/exec');
var log = require('../tools/log');
var opts = require('../opts');

module.exports = function (cb) {
async.waterfall([
function (_cb) {
exec('gulp sass', function (err, data) {
if (err) return false;
return _cb(null);
});
},

function (_cb) {
exec('gulp stats --' + opts.nextRelease.name, function (err, data) {
if (err) return false;
return _cb(null);
});
},

function (_cb) {
exec('gulp scripts', function (err, data) {
if (err) return false;
return _cb(null);
});
},

function (_cb) {
exec('gulp icons', function (err, data) {
if (err) return false;
return _cb(null);
});
},

function (_cb) {
cb(null)
},
]);
};
17 changes: 0 additions & 17 deletions release-it/commit/css.js

This file was deleted.

17 changes: 0 additions & 17 deletions release-it/commit/icons.js

This file was deleted.

17 changes: 0 additions & 17 deletions release-it/commit/js.js

This file was deleted.

2 changes: 1 addition & 1 deletion release-it/commit/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var opts = require('../opts');
var exec = require('child_process').exec;

module.exports = function (cb) {
var cmd = 'git push origin ' + opts.nextRelease.name;
var cmd = 'git push origin master';

exec(cmd, function (err, data) {
if (err) return false;
Expand Down
17 changes: 0 additions & 17 deletions release-it/commit/stats.js

This file was deleted.

18 changes: 9 additions & 9 deletions release-it/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ async.waterfall([
require('./release/get-latest'),
require('./release/new/choose-name'),
require('./release/new/confirm-name'),

require('./tag/check-remote'),
require('./tag/check-local'),
require('./tag/create'),
require('./commit/stats').generate,
require('./commit/stats').add,
require('./commit/css').generate,
require('./commit/css').add,
require('./commit/js').generate,
require('./commit/js').add,
require('./commit/icons').generate,
require('./commit/icons').add,
require('./commit/create'),
require('./tag/push'),

require('./assets/generate'),
require('./assets/check'),
require('./assets/add'),

require('./commit/create'),
require('./commit/push'),
require('./release/publish')
]);
13 changes: 13 additions & 0 deletions release-it/tag/check-local.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var opts = require('../opts');
var log = require('../tools/log');
var exec = require('child_process').exec;

module.exports = function (cb) {
var cmd = 'git show-ref refs/tags/' + opts.nextRelease.name;

exec(cmd, function (err, data) {
return data ?
log('✗ Tag already exist in local') :
cb(null);
});
};
13 changes: 13 additions & 0 deletions release-it/tag/check-remote.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var opts = require('../opts');
var log = require('../tools/log');
var exec = require('child_process').exec;

module.exports = function (cb) {
var cmd = 'git ls-remote origin refs/tags/' + opts.nextRelease.name;

exec(cmd, function (err, data) {
return data ?
log('✗ Tag already exist in remote') :
cb(null);
});
};

0 comments on commit 54e205f

Please sign in to comment.