Skip to content

Commit

Permalink
add gulp support, fix #6
Browse files Browse the repository at this point in the history
  • Loading branch information
everyx committed Mar 20, 2017
1 parent 66ee83b commit 3025f9e
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 39 deletions.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
*.zip
*.gz
# Do not index node.js modules that are used for building
node_modules

# Do not index releases
release
22 changes: 0 additions & 22 deletions build.sh

This file was deleted.

15 changes: 0 additions & 15 deletions composer.json

This file was deleted.

46 changes: 46 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
var eventStream = require('event-stream'),
gulp = require('gulp'),
chmod = require('gulp-chmod'),
zip = require('gulp-zip'),
tar = require('gulp-tar'),
gzip = require('gulp-gzip'),
rename = require('gulp-rename');

gulp.task('prepare-release', function() {
var version = require('./package.json').version;

return eventStream.merge(
getSources()
.pipe(zip('mibew-operator-status-plugin-' + version + '.zip')),
getSources()
.pipe(tar('mibew-operator-status-plugin-' + version + '.tar'))
.pipe(gzip())
)
.pipe(chmod(0644))
.pipe(gulp.dest('release'));
});

// Builds and packs plugins sources
gulp.task('default', ['prepare-release'], function() {
// The "default" task is just an alias for "prepare-release" task.
});

/**
* Returns files stream with the plugin sources.
*
* @returns {Object} Stream with VinylFS files.
*/
var getSources = function() {
return gulp.src([
'Controller/*',
'LICENSE',
'Plugin.php',
'README.md',
'routing.yml'
],
{base: './'}
)
.pipe(rename(function(path) {
path.dirname = 'Mibew/Mibew/Plugin/OperatorStatus/' + path.dirname;
}));
}
12 changes: 12 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "0.3.0",
"devDependencies": {
"event-stream": "~3.3.1",
"gulp": "^3.9.1",
"gulp-chmod": "~1.2.0",
"gulp-gzip": "~1.1.0",
"gulp-rename": "~1.2.2",
"gulp-tar": "~1.4.0",
"gulp-zip": "~3.0.2"
}
}

0 comments on commit 3025f9e

Please # to comment.