creating release scripts
This commit is contained in:
parent
4c6eeac71b
commit
46195d653a
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
|||||||
.idea/
|
.idea/
|
||||||
|
release
|
||||||
PiGallery2.iml
|
PiGallery2.iml
|
||||||
node_modules/
|
node_modules/
|
||||||
typings/
|
typings/
|
||||||
|
|||||||
11
.npmignore
Normal file
11
.npmignore
Normal 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
|
||||||
@ -9,3 +9,7 @@ deploy:
|
|||||||
app: pigallery2
|
app: pigallery2
|
||||||
on:
|
on:
|
||||||
repo: bpatrik/PiGallery2
|
repo: bpatrik/PiGallery2
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- "node_modules"
|
||||||
|
script: npm run build
|
||||||
|
|||||||
@ -64,8 +64,7 @@ export const hardwareRenderer = (input: RendererInput, done) => {
|
|||||||
const ratio = metadata.height / metadata.width;
|
const ratio = metadata.height / metadata.width;
|
||||||
if (input.makeSquare == false) {
|
if (input.makeSquare == false) {
|
||||||
const newWidth = Math.round(Math.sqrt((input.size * input.size) / ratio));
|
const newWidth = Math.round(Math.sqrt((input.size * input.size) / ratio));
|
||||||
console.log(image
|
image.resize(newWidth);
|
||||||
.resize(newWidth));
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
image
|
image
|
||||||
|
|||||||
@ -2,12 +2,12 @@
|
|||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
import {DirectoryDTO} from "../../common/entities/DirectoryDTO";
|
import {DirectoryDTO} from "../../common/entities/DirectoryDTO";
|
||||||
import {
|
import {
|
||||||
|
CameraMetadata,
|
||||||
|
GPSMetadata,
|
||||||
|
ImageSize,
|
||||||
PhotoDTO,
|
PhotoDTO,
|
||||||
PhotoMetadata,
|
PhotoMetadata,
|
||||||
ImageSize,
|
PositionMetaData
|
||||||
CameraMetadata,
|
|
||||||
PositionMetaData,
|
|
||||||
GPSMetadata
|
|
||||||
} from "../../common/entities/PhotoDTO";
|
} from "../../common/entities/PhotoDTO";
|
||||||
import {ProjectPath} from "../ProjectPath";
|
import {ProjectPath} from "../ProjectPath";
|
||||||
|
|
||||||
@ -170,7 +170,6 @@ pool.run(
|
|||||||
|
|
||||||
|
|
||||||
parseDir(input).then((dir) => {
|
parseDir(input).then((dir) => {
|
||||||
console.log(dir);
|
|
||||||
done(null, dir);
|
done(null, dir);
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
done(err, null);
|
done(err, null);
|
||||||
|
|||||||
43
gulpfile.js
Normal file
43
gulpfile.js
Normal 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();
|
||||||
|
});
|
||||||
|
});
|
||||||
10
package.json
10
package.json
@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "PiGallery2",
|
"name": "PiGallery2",
|
||||||
"version": "0.1.0",
|
"version": "1.0.0-beta.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"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": "Braun Patrik",
|
"author": "Patrik J. Braun",
|
||||||
"homepage": "https://github.com/bpatrik/PiGallery2",
|
"homepage": "https://github.com/bpatrik/PiGallery2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./backend/server.js",
|
"main": "./backend/server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "tsc",
|
"build": "tsc",
|
||||||
"pretest": "tsc",
|
"pretest": "tsc",
|
||||||
"test": "karma start karma.conf.js --single-run && mocha --recursive test/backend/unit",
|
"test": "karma start karma.conf.js --single-run && mocha --recursive test/backend/unit",
|
||||||
"start": "node ./backend/server"
|
"start": "node ./backend/server"
|
||||||
@ -61,6 +61,8 @@
|
|||||||
"@types/optimist": "0.0.29",
|
"@types/optimist": "0.0.29",
|
||||||
"@types/sharp": "^0.17.1",
|
"@types/sharp": "^0.17.1",
|
||||||
"chai": "^4.0.0",
|
"chai": "^4.0.0",
|
||||||
|
"gulp": "^3.9.1",
|
||||||
|
"gulp-typescript": "^3.1.7",
|
||||||
"jasmine-core": "^2.6.2",
|
"jasmine-core": "^2.6.2",
|
||||||
"karma": "^1.7.0",
|
"karma": "^1.7.0",
|
||||||
"karma-cli": "^1.0.1",
|
"karma-cli": "^1.0.1",
|
||||||
@ -69,11 +71,13 @@
|
|||||||
"karma-phantomjs-launcher": "^1.0.4",
|
"karma-phantomjs-launcher": "^1.0.4",
|
||||||
"karma-remap-istanbul": "^0.6.0",
|
"karma-remap-istanbul": "^0.6.0",
|
||||||
"karma-systemjs": "^0.16.0",
|
"karma-systemjs": "^0.16.0",
|
||||||
|
"merge2": "^1.0.3",
|
||||||
"mocha": "^3.4.2",
|
"mocha": "^3.4.2",
|
||||||
"phantomjs-prebuilt": "^2.1.14",
|
"phantomjs-prebuilt": "^2.1.14",
|
||||||
"protractor": "^5.1.2",
|
"protractor": "^5.1.2",
|
||||||
"remap-istanbul": "^0.9.5",
|
"remap-istanbul": "^0.9.5",
|
||||||
"rimraf": "^2.6.1",
|
"rimraf": "^2.6.1",
|
||||||
|
"run-sequence": "^1.2.2",
|
||||||
"ts-helpers": "^1.1.2",
|
"ts-helpers": "^1.1.2",
|
||||||
"tslint": "^5.3.2",
|
"tslint": "^5.3.2",
|
||||||
"typescript": "^2.3.3"
|
"typescript": "^2.3.3"
|
||||||
|
|||||||
@ -11,12 +11,12 @@
|
|||||||
"es2015",
|
"es2015",
|
||||||
"dom",
|
"dom",
|
||||||
"es2015.promise"
|
"es2015.promise"
|
||||||
],
|
|
||||||
"typeRoots": [
|
|
||||||
"./node_modules/@types"
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules"
|
"node_modules"
|
||||||
|
],
|
||||||
|
"typeRoots": [
|
||||||
|
"node_modules/@types"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user