添加打包和启动脚本

This commit is contained in:
zhl 2019-05-28 16:53:34 +08:00
parent c5dea293ad
commit 25b4f4011b
4 changed files with 56 additions and 1 deletions

18
boundle.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash
source /etc/profile
npm install --prefer-offline --loglevel info --unsafe-perm=true --allow-root >> boundle.log
[ "$(which gulp)" = "" ] && {
npm install -g gulp
echo 1>&2 "Install gulp done" >> boundle.log
}
gulp >> boundle.log
echo 'finish gulp task' >> boundle.log
tar -zcvf movie_spider.tar.gz ./
echo 'finish compress all code' >> boundle.log
mkdir target && mv ./movie_spider.tar.gz ./target/movie_spider.tar.gz
echo 'all done' 2>&1 >> boundle.log

9
gulpfile.babel.js Normal file
View File

@ -0,0 +1,9 @@
'use strict';
import gulp from 'gulp';
import babel from 'gulp-babel';
gulp.task('default', () => {
return gulp.src('src/**/*.js')
.pipe(babel())
.pipe(gulp.dest('lib'));
});

View File

@ -43,6 +43,8 @@
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-preset-node8": "^1.2.0",
"babel-register": "^6.24.1"
"babel-register": "^6.24.1",
"gulp": "3.9.1",
"gulp-babel": "6.1.2"
}
}

26
start.json Normal file
View File

@ -0,0 +1,26 @@
{
"apps": [
{
"name": "ghost",
"script": "lib/app.js",
"cwd": "/data/apps/movie_spider",
"max_memory_restart": "1024M",
"log_date_format" : "YYYY-MM-DD HH:mm Z",
"watch": true,
"ignore_watch": [
"node_modules",
"logs",
"fixtures",
"tasks"
],
"instances": 1,
"exec_mode": "cluster",
"env": {
"NODE_ENV": "production"
},
"env_production": {
"NODE_ENV": "production"
}
}
]
}