add boundle and pm2 start script
This commit is contained in:
parent
b569d84ad6
commit
8b59cbf451
15
boundle.sh
Normal file
15
boundle.sh
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
source /etc/profile
|
||||||
|
|
||||||
|
npm install --prefer-offline --loglevel info --unsafe-perm=true --allow-root >> boundle.log
|
||||||
|
echo 'copy node_modules to /data/publish/node_packages' >> boundle.log
|
||||||
|
|
||||||
|
gulp
|
||||||
|
|
||||||
|
rm -rf ./src
|
||||||
|
|
||||||
|
tar -zcvf garfield.tar.gz ./
|
||||||
|
|
||||||
|
mkdir target && mv ./garfield.tar.gz ./target/garfield.tar.gz
|
||||||
|
echo 'all done' 2>&1 >> boundle.log
|
18
gulpfile.babel.js
Normal file
18
gulpfile.babel.js
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
'use strict';
|
||||||
|
import gulp from 'gulp';
|
||||||
|
import babel from 'gulp-babel';
|
||||||
|
import sourcemaps from 'gulp-sourcemaps';
|
||||||
|
|
||||||
|
const compileCode = function() {
|
||||||
|
return gulp.src(['src/**/*'])
|
||||||
|
.pipe(sourcemaps.init())
|
||||||
|
.pipe(babel({
|
||||||
|
presets: ['node8'],
|
||||||
|
}))
|
||||||
|
.pipe(sourcemaps.write('.'))
|
||||||
|
.pipe(gulp.dest('lib/'));
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
gulp.task('default', compileCode);
|
@ -49,7 +49,10 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"babel-cli": "^6.26.0",
|
"babel-cli": "^6.26.0",
|
||||||
"babel-preset-env": "^1.7.0",
|
"babel-preset-node8": "1.2.0",
|
||||||
"cross-env": "^5.2.0"
|
"cross-env": "^5.2.0",
|
||||||
|
"gulp": "3.9.1",
|
||||||
|
"gulp-babel": "6.1.2",
|
||||||
|
"gulp-sourcemaps": "^2.6.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
26
start.json
Normal file
26
start.json
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"apps": [
|
||||||
|
{
|
||||||
|
"name": "pikachu-be",
|
||||||
|
"script": "lib/app.js",
|
||||||
|
"cwd": "/data/apps/pikachu-be",
|
||||||
|
"max_memory_restart": "1024M",
|
||||||
|
"log_date_format" : "YYYY-MM-DD HH:mm Z",
|
||||||
|
"watch": true,
|
||||||
|
"ignore_watch": [
|
||||||
|
"node_modules",
|
||||||
|
"logs",
|
||||||
|
"public",
|
||||||
|
"fixtures"
|
||||||
|
],
|
||||||
|
"instances": 1,
|
||||||
|
"exec_mode": "cluster",
|
||||||
|
"env": {
|
||||||
|
"NODE_ENV": "production"
|
||||||
|
},
|
||||||
|
"env_production": {
|
||||||
|
"NODE_ENV": "production"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user