Skip to content

Commit

Permalink
Added preliminary gulp-based build system for releases
Browse files Browse the repository at this point in the history
  • Loading branch information
FelixHenninger committed Oct 23, 2015
1 parent 1dc5a14 commit af006ec
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,8 @@ docs/_build/

# PyBuilder
target/

# Sketchy gulp-based build system
build/
node_modules
release.zip
56 changes: 56 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -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']);

0 comments on commit af006ec

Please sign in to comment.