From ca950da1d24837772f6ae21635ee0042a90a4d30 Mon Sep 17 00:00:00 2001 From: Juanfran Date: Fri, 16 Jan 2015 14:48:27 +0100 Subject: [PATCH] node compile taiga-front script --- .gitignore | 2 ++ README.md | 17 ++++++++++++++++ dist.js | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 21 ++++++++++++++++++++ 4 files changed, 95 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 dist.js create mode 100644 package.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..104d999 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +tmp/ \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..41edc1f --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# Taiga Front # + +![Kaleidos Project](http://kaleidos.net/static/img/badge.png "Kaleidos Project") + +##Installation + +* Clone the repo +* Edit your configuration file `dist/js/conf.js` +* Expose the `dist` directory under a static file web server + +More information about the different installation methods (production, development, vagrant, docker...) can be found here http://taigaio.github.io/taiga-doc/dist/#_installation_guide. + +## Community ## + +[Taiga has a mailing list](http://groups.google.com/d/forum/taigaio). Feel free to join it and ask any questions you may have. + +To subscribe for announcements of releases, important changes and so on, please follow [@taigaio](https://twitter.com/taigaio) on Twitter. diff --git a/dist.js b/dist.js new file mode 100644 index 0000000..e2f4e36 --- /dev/null +++ b/dist.js @@ -0,0 +1,55 @@ +var Promise = require("bluebird"); +var fs = require("fs"); +var delAsync = Promise.promisify(require("del")); +var exec = Promise.promisify(require('child_process').exec); +var ncp = Promise.promisify(require('ncp').ncp); + +var local = 'tmp'; +var repo = 'https://github.com/taigaio/taiga-front'; + +var params = process.argv.slice(2); + +if (params.length !== 2) { + throw "Github user & password rerquired"; +} + +var action = (function cloneOrPull(){ + var cloned = fs.existsSync(local); + + if (cloned) { + action = 'cd ' + local + ' && git pull'; + } else { + action = 'git clone ' + repo + ' ' + local; + } + + return action; +}()) + +exec(action) + .then(function() { + //compile taiga + return exec('cd ' + local + ' && npm install && bower install && gulp deploy'); + }) + .then(function() { + //remove old dist + return delAsync('dist'); + }) + .then(function() { + //copy new dist + return ncp(local + '/dist/', 'dist'); + }) + .then(function() { + //get last commit id + return exec('cd ' + local + ' && git rev-parse HEAD'); + }) + .then(function(lastCommitId) { + //commit + lastCommitId = lastCommitId[0].trim(); + + return exec('git add -A && git commit -am "' + lastCommitId + '"'); + }) + .then(function() { + //push + return exec('git push --repo https://' + params[0] + ':' + params[0] + '@github.com:taigaio/taiga-front-dist.git master'); + }) + .done(); diff --git a/package.json b/package.json new file mode 100644 index 0000000..bd2c1a6 --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "TaigaIO", + "keywords": [ + "Taiga", + "Agile", + "Project Management", + "Github" + ], + "author": "Kaleidos OpenSource SL", + "licenses": [ + { + "type": "AGPL-3.0", + "url": "https://github.com/taigaio/taiga-front/blob/master/LICENSE" + } + ], + "devDependencies": { + "bluebird": "^2.6.4", + "del": "^1.1.1", + "ncp": "^1.0.1" + } +}