1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2024-12-25 02:04:15 +02:00

creating release scripts

This commit is contained in:
Braun Patrik 2017-06-02 22:31:51 +02:00
parent 4c6eeac71b
commit 46195d653a
8 changed files with 74 additions and 13 deletions

1
.gitignore vendored
View File

@ -1,4 +1,5 @@
.idea/
release
PiGallery2.iml
node_modules/
typings/

11
.npmignore Normal file
View File

@ -0,0 +1,11 @@
.idea/
node_modules/
demo
test
karma-test-shim.js
karma.conf.js
Procfile
users.db
.travis.yml
*.ts
PiGallery2.iml

View File

@ -9,3 +9,7 @@ deploy:
app: pigallery2
on:
repo: bpatrik/PiGallery2
cache:
directories:
- "node_modules"
script: npm run build

View File

@ -64,8 +64,7 @@ export const hardwareRenderer = (input: RendererInput, done) => {
const ratio = metadata.height / metadata.width;
if (input.makeSquare == false) {
const newWidth = Math.round(Math.sqrt((input.size * input.size) / ratio));
console.log(image
.resize(newWidth));
image.resize(newWidth);
} else {
image

View File

@ -2,12 +2,12 @@
import * as path from "path";
import {DirectoryDTO} from "../../common/entities/DirectoryDTO";
import {
CameraMetadata,
GPSMetadata,
ImageSize,
PhotoDTO,
PhotoMetadata,
ImageSize,
CameraMetadata,
PositionMetaData,
GPSMetadata
PositionMetaData
} from "../../common/entities/PhotoDTO";
import {ProjectPath} from "../ProjectPath";
@ -170,7 +170,6 @@ pool.run(
parseDir(input).then((dir) => {
console.log(dir);
done(null, dir);
}).catch((err) => {
done(err, null);

43
gulpfile.js Normal file
View File

@ -0,0 +1,43 @@
var ts = require('gulp-typescript');
var del = require('del');
var gulp = require('gulp');
var merge = require('merge2');
var runSequence = require('run-sequence');
var tsProject = ts.createProject('tsconfig.json');
gulp.task('clean', function () {
return del('release/');
});
gulp.task("copy-files", function () {
return gulp
.src(['package.json',
".npmignore",
"frontend/**/*.+(png|ejs|html|css)",
"frontend/systemjs*"], {base: "."})
.pipe(gulp.dest("release"));
});
gulp.task('compile-release', function () {
return merge(
['frontend',
'common',
'backend'].map(function (dir) {
var tsProject = ts.createProject('tsconfig.json');
return gulp.src(dir + "/**/*.ts")
.pipe(tsProject())
.js
.pipe(gulp.dest("release/" + dir))
})
);
});
gulp.task('build-release', function (done) {
runSequence('clean', 'copy-files', 'compile-release', function () {
console.log('Run something else');
done();
});
});

View File

@ -1,14 +1,14 @@
{
"name": "PiGallery2",
"version": "0.1.0",
"version": "1.0.0-beta.0",
"private": true,
"description": "This is a photo gallery optimised for running low resource servers (especially on raspberry pi)",
"author": "Braun Patrik",
"author": "Patrik J. Braun",
"homepage": "https://github.com/bpatrik/PiGallery2",
"license": "MIT",
"main": "./backend/server.js",
"scripts": {
"postinstall": "tsc",
"build": "tsc",
"pretest": "tsc",
"test": "karma start karma.conf.js --single-run && mocha --recursive test/backend/unit",
"start": "node ./backend/server"
@ -61,6 +61,8 @@
"@types/optimist": "0.0.29",
"@types/sharp": "^0.17.1",
"chai": "^4.0.0",
"gulp": "^3.9.1",
"gulp-typescript": "^3.1.7",
"jasmine-core": "^2.6.2",
"karma": "^1.7.0",
"karma-cli": "^1.0.1",
@ -69,11 +71,13 @@
"karma-phantomjs-launcher": "^1.0.4",
"karma-remap-istanbul": "^0.6.0",
"karma-systemjs": "^0.16.0",
"merge2": "^1.0.3",
"mocha": "^3.4.2",
"phantomjs-prebuilt": "^2.1.14",
"protractor": "^5.1.2",
"remap-istanbul": "^0.9.5",
"rimraf": "^2.6.1",
"run-sequence": "^1.2.2",
"ts-helpers": "^1.1.2",
"tslint": "^5.3.2",
"typescript": "^2.3.3"

View File

@ -11,12 +11,12 @@
"es2015",
"dom",
"es2015.promise"
],
"typeRoots": [
"./node_modules/@types"
]
},
"exclude": [
"node_modules"
],
"typeRoots": [
"node_modules/@types"
]
}