1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2025-01-12 04:23:09 +02:00

updating gulp file of building release

This commit is contained in:
Braun Patrik 2017-07-11 22:10:36 +02:00
parent 314bbbae34
commit 0489c8e1d4
4 changed files with 66 additions and 41 deletions

1
.gitignore vendored
View File

@ -18,3 +18,4 @@ demo/TEMP/
config.json config.json
users.db users.db
dist/ dist/
release/

View File

@ -21,8 +21,7 @@ deploy:
secure: NrgDMoHY4j9r4Ht9oPT6cYiGkcpbNsvR6DxEk51kD5qVRPtUq+V5gpIo0tSwIFfPzgY+5hsqK6Onl2AdSsaotHB8PT2CoZ9oZPJO8BlZFvD7iT83Qi49QcsMo6jjmgqByg6EwzhHLeAiMfYrNSqw1gT0tEONc9Ygq5deFolYSqf6yfplBkcT0HEFSncnDhn5i+s4SS/wOy/UppXJxKk9DE0GaRwaIuBC/aSAtDfoFUuxVwjahTiTb8YuqwguzoZA5lYC/EcoCxbSyb5y58XrsMB13AZmH271NlbSTYmo3c4+HGO4BkcIB/WATw9VcI1NU/huTgSNZnVzAalbtF9oWKG+IKyfa9gMbe6fj07CvB7KwCkaeJmToi5Hw3Eiw0+ioadEzD3KXRr0dchUjlYuYnmZEUxSAVW9jD+tJSdCxQKyna3PxtIcD7QvRlu8/ZXurcerZXVib5FbwmoXUzLZvbMeyaFHEMbawepp5xups/YYqp+I6H0SUqbMcNIAntENb/0doteXKwdOgsSUkdtMVoEM0p6PhFngFJLFPYAdq0yZiC8WQNwHNTBHcSME3CrIWk1sjrDjN8WylFTPljy7fNm2Rl2UFHvdtGHo5e5YEltHGdlcnSD4ZhXKCn3blR7O87taNUEAjljgjxdridbUrAJ3ooJRVPicVfeslVCM+OQ= secure: NrgDMoHY4j9r4Ht9oPT6cYiGkcpbNsvR6DxEk51kD5qVRPtUq+V5gpIo0tSwIFfPzgY+5hsqK6Onl2AdSsaotHB8PT2CoZ9oZPJO8BlZFvD7iT83Qi49QcsMo6jjmgqByg6EwzhHLeAiMfYrNSqw1gT0tEONc9Ygq5deFolYSqf6yfplBkcT0HEFSncnDhn5i+s4SS/wOy/UppXJxKk9DE0GaRwaIuBC/aSAtDfoFUuxVwjahTiTb8YuqwguzoZA5lYC/EcoCxbSyb5y58XrsMB13AZmH271NlbSTYmo3c4+HGO4BkcIB/WATw9VcI1NU/huTgSNZnVzAalbtF9oWKG+IKyfa9gMbe6fj07CvB7KwCkaeJmToi5Hw3Eiw0+ioadEzD3KXRr0dchUjlYuYnmZEUxSAVW9jD+tJSdCxQKyna3PxtIcD7QvRlu8/ZXurcerZXVib5FbwmoXUzLZvbMeyaFHEMbawepp5xups/YYqp+I6H0SUqbMcNIAntENb/0doteXKwdOgsSUkdtMVoEM0p6PhFngFJLFPYAdq0yZiC8WQNwHNTBHcSME3CrIWk1sjrDjN8WylFTPljy7fNm2Rl2UFHvdtGHo5e5YEltHGdlcnSD4ZhXKCn3blR7O87taNUEAjljgjxdridbUrAJ3ooJRVPicVfeslVCM+OQ=
file: pigallery2.zip file: pigallery2.zip
skip_cleanup: true skip_cleanup: true
on: on:
repo: bpatrik/pigallery2
tags: true tags: true
provider: heroku provider: heroku

View File

@ -2,34 +2,57 @@ var ts = require('gulp-typescript');
var gulp = require('gulp'); var gulp = require('gulp');
var zip = require('gulp-zip'); var zip = require('gulp-zip');
var runSequence = require('run-sequence'); var runSequence = require('run-sequence');
var jsonModify = require('gulp-json-modify');
var exec = require('child_process').exec;
var tsProject = ts.createProject('tsconfig.json'); var tsProject = ts.createProject('tsconfig.json');
gulp.task('compile-release', function () { gulp.task('build-backend', function () {
return gulp.src([ return gulp.src([
"frontend/**/*.ts", "common/**/*.ts",
"common/**/*.ts", "backend/**/*.ts"], {base: "."})
"backend/**/*.ts"], {base: "."}) .pipe(tsProject())
.pipe(tsProject()) .js
.js .pipe(gulp.dest("./release"))
.pipe(gulp.dest("."))
}); });
gulp.task('build-frontend', function (cb) {
exec("ng build -prod --output-path=./release/dist --no-progress", function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
});
gulp.task('copy-static', function () {
return gulp.src([
"README.md",
"LICENSE"], {base: "."})
.pipe(gulp.dest('./release'));
});
gulp.task('copy-package', function () {
return gulp.src([
"package.json"], {base: "."})
.pipe(jsonModify({
key: 'devDependencies',
value: {}
}))
.pipe(jsonModify({
key: 'scripts',
value: {"start": "node ./backend/index.js"}
}))
.pipe(gulp.dest('./release'));
});
gulp.task('zip-release', function () { gulp.task('zip-release', function () {
return gulp.src(['package.json', return gulp.src(['release/*'], {base: "."})
"README.md", .pipe(zip('pigallery2.zip'))
"LICENSE", .pipe(gulp.dest('.'));
"frontend/**/*.js",
"common/**/*.js",
"backend/**/*.js",
"frontend/**/*.+(png|ejs|html|css)",
"frontend/systemjs*"], {base: "."})
.pipe(zip('pigallery2.zip'))
.pipe(gulp.dest('.'));
}); });
gulp.task('build-release', function (done) { gulp.task('build-release', function (done) {
runSequence('compile-release', 'zip-release', function () { runSequence('build-frontend', 'build-backend', 'copy-static', 'copy-package', 'zip-release', function () {
console.log('Run something else'); done();
done(); });
}); });
});

View File

@ -1,6 +1,6 @@
{ {
"name": "pigallery2", "name": "pigallery2",
"version": "1.0.0-beta.2", "version": "1.0.0-beta.3",
"description": "This is a photo gallery optimised for running low resource servers (especially on raspberry pi)", "description": "This is a photo gallery optimised for running low resource servers (especially on raspberry pi)",
"author": "Patrik J. Braun", "author": "Patrik J. Braun",
"homepage": "https://github.com/bpatrik/PiGallery2", "homepage": "https://github.com/bpatrik/PiGallery2",
@ -9,6 +9,7 @@
"bin": "./backend/index.js", "bin": "./backend/index.js",
"scripts": { "scripts": {
"build": "tsc && ng build", "build": "tsc && ng build",
"build-release": "gulp",
"pretest": "tsc", "pretest": "tsc",
"test": "ng test --single-run && mocha --recursive test/backend/unit", "test": "ng test --single-run && mocha --recursive test/backend/unit",
"start": "node ./backend/index", "start": "node ./backend/index",
@ -24,22 +25,22 @@
"url": "https://github.com/bpatrik/PiGallery2/issues" "url": "https://github.com/bpatrik/PiGallery2/issues"
}, },
"dependencies": { "dependencies": {
"@types/bcryptjs": "^2.4.0", "@types/bcryptjs": "2.4.0",
"bcryptjs": "^2.4.3", "bcryptjs": "2.4.3",
"body-parser": "^1.17.2", "body-parser": "1.17.2",
"ejs": "^2.5.6", "ejs": "2.5.6",
"exif-parser": "^0.1.11", "exif-parser": "0.1.11",
"express": "^4.15.3", "express": "4.15.3",
"express-session": "^1.15.3", "express-session": "1.15.3",
"flat-file-db": "^1.0.0", "flat-file-db": "1.0.0",
"jimp": "^0.2.28", "jimp": "0.2.28",
"mime": "^1.3.6", "mime": "1.3.6",
"mysql": "^2.13.0", "mysql": "2.13.0",
"node-iptc": "^1.0.4", "node-iptc": "1.0.4",
"reflect-metadata": "^0.1.10", "reflect-metadata": "0.1.10",
"typeconfig": "^1.0.3", "typeconfig": "1.0.3",
"typeorm": "0.0.11", "typeorm": "0.0.11",
"winston": "^2.3.1" "winston": "2.3.1"
}, },
"devDependencies": { "devDependencies": {
"@agm/core": "^1.0.0-beta.0", "@agm/core": "^1.0.0-beta.0",
@ -69,6 +70,7 @@
"core-js": "^2.4.1", "core-js": "^2.4.1",
"ejs-loader": "^0.3.0", "ejs-loader": "^0.3.0",
"gulp": "^3.9.1", "gulp": "^3.9.1",
"gulp-json-modify": "^1.0.2",
"gulp-typescript": "^3.2.0", "gulp-typescript": "^3.2.0",
"gulp-zip": "^4.0.0", "gulp-zip": "^4.0.0",
"intl": "^1.2.5", "intl": "^1.2.5",