From 25b4f4011b0b008738653a2ce74302d46ac06f29 Mon Sep 17 00:00:00 2001 From: zhl Date: Tue, 28 May 2019 16:53:34 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=93=E5=8C=85=E5=92=8C?= =?UTF-8?q?=E5=90=AF=E5=8A=A8=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- boundle.sh | 18 ++++++++++++++++++ gulpfile.babel.js | 9 +++++++++ package.json | 4 +++- start.json | 26 ++++++++++++++++++++++++++ 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100755 boundle.sh create mode 100644 gulpfile.babel.js create mode 100644 start.json diff --git a/boundle.sh b/boundle.sh new file mode 100755 index 0000000..5b1d6b6 --- /dev/null +++ b/boundle.sh @@ -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 diff --git a/gulpfile.babel.js b/gulpfile.babel.js new file mode 100644 index 0000000..0e7620c --- /dev/null +++ b/gulpfile.babel.js @@ -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')); +}); diff --git a/package.json b/package.json index 852e124..f7cc135 100644 --- a/package.json +++ b/package.json @@ -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" } } diff --git a/start.json b/start.json new file mode 100644 index 0000000..a46f04c --- /dev/null +++ b/start.json @@ -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" + } + } + ] +}