From a7021b9212509693a3652afa09561120883d26fc Mon Sep 17 00:00:00 2001 From: Kevin Jahns Date: Wed, 4 Nov 2015 14:32:04 +0100 Subject: [PATCH] Deploy 0.6.16 --- gulpfile.js | 39 +++++++++++++++++++++------------------ package.json | 3 ++- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 26f950bc..51f78a7c 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -52,7 +52,7 @@ var jasmine = require('gulp-jasmine') var jasmineBrowser = require('gulp-jasmine-browser') var concat = require('gulp-concat') var watch = require('gulp-watch') -var exec = require('child_process').exec +var shell = require('gulp-shell') var $ = require('gulp-load-plugins')() var options = minimist(process.argv.slice(2), { @@ -129,23 +129,26 @@ gulp.task('deploy:bump', function () { .pipe(gulp.dest('./')) }) -gulp.task('deploy:commit', function () { - gulp.src(['./*', '!./node_modules', '!./build', '!./y.*', '!./dist'] ) - .pipe($.git.commit('bumps package version', {args: '-n'})) - return gulp.src('./dist/*') - .pipe($.git.commit('New release', { maxBuffer: 20000 * 1024, args: '-n', cwd: './dist'})) -}) - -gulp.task('deploy:tag', function () { - return gulp.src('./package.json') - .pipe($.tagVersion({cwd: './dist'})) -}) - -gulp.task('deploy', ['deploy:updateSubmodule', 'deploy:bump', 'deploy:build', 'deploy:copy', 'deploy:commit', 'deploy:tag'], function (cb) { - exec('echo yayy && echo yooo', function (err, stdout, stderr) { - console.log(err) - cb(err) - }) +gulp.task('deploy', ['deploy:updateSubmodule', 'deploy:bump', 'deploy:build', 'deploy:copy'], function () { + return gulp.src('./package.json', {read: false}) + .pipe(shell([ + 'echo "Deploying version <%= getVersion(file.path) %>"', + 'cd ./dist/', + 'git add -A', + 'git commit -am "Deploy <%= getVersion(file.path) %>" -n', + 'git tag -a v<%= getVersion(file.path) %>', + 'git push', + 'git push origin --tags', + 'cd ..', + 'git commit -am "Release <%= getVersion(file.path) %>" -n', + 'git push' + ], { + templateData: { + getVersion: function (s) { + return require(s).version + } + } + })) }) gulp.task('build:test', function () { diff --git a/package.json b/package.json index 8db37a8a..65f54859 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yjs", - "version": "0.6.15", + "version": "0.6.17", "description": "A framework for real-time p2p shared editing on arbitrary complex data types", "main": "y.js", "scripts": { @@ -51,6 +51,7 @@ "gulp-jasmine": "^2.0.1", "gulp-jasmine-browser": "^0.2.3", "gulp-load-plugins": "^1.0.0", + "gulp-shell": "^0.5.1", "gulp-sourcemaps": "^1.5.2", "gulp-tag-version": "^1.3.0", "gulp-uglify": "^1.4.1",