From af006ec43dce4d6c3775e0bd3ffb3609ca4d32ec Mon Sep 17 00:00:00 2001 From: Felix Henninger Date: Sat, 24 Oct 2015 01:30:19 +0200 Subject: [PATCH] Added preliminary gulp-based build system for releases --- .gitignore | 5 +++++ gulpfile.js | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 gulpfile.js diff --git a/.gitignore b/.gitignore index 7d44098..ef22dcb 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,8 @@ docs/_build/ # PyBuilder target/ + +# Sketchy gulp-based build system +build/ +node_modules +release.zip diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..a1d0cd2 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,56 @@ +var gulp = require('gulp'), + download = require('gulp-download'), + zip = require('gulp-zip'), + unzip = require('gulp-unzip'); + +gulp.task('download-dependencies', function() { + // Download and copy python psynteract library + download('https://github.com/psynteract/psynteract-py/archive/master.zip') + .pipe(unzip()) + .pipe(gulp.dest('build/_dependencies/')); + + // Same for requests ... + download('https://github.com/kennethreitz/requests/archive/v2.5.1.zip') + .pipe(unzip()) + .pipe(gulp.dest('build/_dependencies/')); + + // ... and pycouchdb + download('https://github.com/histrio/py-couchdb/archive/1.13.zip') + .pipe(unzip()) + .pipe(gulp.dest('build/_dependencies/')); +}) + +gulp.task('bundle', function() { + // Copy metadata + gulp.src(['./README.md', './LICENSE', './NOTICE.md']) + .pipe(gulp.dest('build/_output/')); + + // Copy extensions and plugins + gulp.src(['./extensions/**/*']) + .pipe(gulp.dest('build/_output/extensions/')); + gulp.src(['./plugins/**/*']) + .pipe(gulp.dest('build/_output/plugins/')); + + // Copy dependency files + gulp.src('build/_dependencies/psynteract-py-master/psynteract/**/*') + .pipe(gulp.dest('build/_output/extensions/psynteract_extension/psynteract')); + gulp.src('build/_dependencies/requests-2.5.1/requests/**/*') + .pipe(gulp.dest('build/_output/extensions/psynteract_extension/requests')); + gulp.src('build/_dependencies/py-couchdb-1.13/pycouchdb/**/*') + .pipe(gulp.dest('build/_output/extensions/psynteract_extension/pycouchdb')); + + // Copy backend + // (this currently assumes that the backend + // has been built manually) + gulp.src('build/backend.json') + .pipe(gulp.dest('build/_output/extensions/psynteract_extension/psynteract')); +}); + +gulp.task('zip', function() { + // Zip up the _output directory + gulp.src('build/_output/**/*') + .pipe(zip('release.zip')) + .pipe(gulp.dest('./')); +}); + +gulp.task('default', ['download-dependencies', 'bundle', 'zip']);