Last active
March 28, 2017 14:05
-
-
Save kritollm/c2a76847af0f5e7274034135910c52b0 to your computer and use it in GitHub Desktop.
Gulp script to pack a node app ready for uploading as webjob in azure portal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const gulp = require('gulp'); | |
const zip = require('gulp-zip'); | |
gulp.task('default', () => | |
gulp.src(['**/settings/**/*.json', '**/run.js', '**/app/**/*.js', '**/node_modules/**/*','settings.job']) | |
.pipe(zip('YOUR_APP_NAME' + (new Date()).toJSON() + '.zip')) | |
.pipe(gulp.dest('')) | |
); | |
// 1.The script assumes your app have some settings stored as .json in a drawer named settings (remove if not, ofcourse). | |
// 2.The main script should have the name run.js, else the azure webjob system executes in sort order. | |
// (That's why app.js works until you make a file named about.js) | |
// 3. All the other scripts stored in a drawer named app | |
// 4. All node modules must be included | |
// 5 settings.job if you have any. | |
// 6. Filename is 'YOUR_APP_NAME' + a simple version system. | |
// 7. Store the zipped file in main directory, or replace '' with 'YOUR_DRAWER' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment