Authored by 陈峰

Merge branch 'feature/change' into 'master'

Feature/change



See merge request !109
// 将设置放入此文件中以覆盖默认值和用户设置。
{
"files.exclude": {
"public/dist/": true,
"logs/": true
},
"vetur.grammar.customBlocks": {
... ...
... ... @@ -6,26 +6,23 @@
# nginx version: 1.12.0
############################################################
#base image : ccr.ccs.tencentyun.com/yoho-base/nodejs:8.9.1
FROM ccr.ccs.tencentyun.com/yoho-base/nodejs:8.9.1
#base image : ccr.ccs.tencentyun.com/yoho-base/node
FROM ccr.ccs.tencentyun.com/yoho-base/node:10.4.1-alpine-fix
MAINTAINER feng.chen <feng.chen@yoho.cn>
ENV NODE_ENV=production \
NODE_HOME=/home
COPY yoho-blk-wap.tar.gz /home
RUN cd /home && \
mkdir -p /home/yoho-blk-wap && \
mkdir -p /Data/log/yoho-blk-wap && \
mkdir -p /Data/log/yohoblk-wap && \
tar -xzvf yoho-blk-wap.tar.gz -C /home/yoho-blk-wap && \
rm -rf yoho-blk-wap.tar.gz
mkdir -p /Data/log/yoho-blk-wap
COPY . /home/yoho-blk-wap
WORKDIR /home/yoho-blk-wap
#expose port
EXPOSE 6004
EXPOSE 6002
CMD ["node","/home/yoho-blk-wap/app.js"]
\ No newline at end of file
... ...
const shelljs = require('shelljs');
const path = require('path');
const distDir = path.join(__dirname, '../dist/node');
shelljs.rm('-rf', distDir);
shelljs.mkdir('-p', distDir);
const cpPaths = [
'favicon.ico',
'.npmrc',
'process.json',
'Dockerfile',
'yarn.lock',
'package.json',
'*.js',
'config',
'apps',
'utils',
'doraemon',
'src/index.html',
'manifest.json'
];
new Promise(resolve => { // 加载manifest.json文件
resolve();
}).then(() => { // 拷贝node代码
cpPaths.forEach(p => {
let dist = distDir;
let file = p;
if (typeof p === 'object') {
dist = path.join(dist, p[1]);
file = p[0];
if (!shelljs.test('-e', dist)) {
shelljs.mkdir('-p', dist);
}
}
shelljs.cp('-R', path.join(__dirname, '../', file), dist);
});
}).then(() => { // 安装依赖和清理node_modules
shelljs.cd(distDir);
if (shelljs.exec('yarn --production=true').code !== 0) {
throw 'yarn install faild';
}
}).catch(error => {
console.error(`error:${error}`);
return process.exit(1); //eslint-disable-line
});
... ...
... ... @@ -2,7 +2,7 @@ const path = require('path');
const ExtractTextPlugin = require('extract-text-webpack-plugin');
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin');
const pkg = require('../package.json');
const distDir = path.join(__dirname, `../public/dist/${pkg.name}/bundle`);
const distDir = path.join(__dirname, `../dist/${pkg.name}/bundle`);
module.exports = {
output: {
... ...
... ... @@ -7,7 +7,7 @@
const isProduction = process.env.NODE_ENV === 'production';
const isTest = process.env.NODE_ENV === 'test';
const isTest = process.env.NODE_ENV === 'test3';
module.exports = {
app: 'h5',
... ... @@ -19,9 +19,9 @@ module.exports = {
business_line: 'yohoblk'
},
domains: {
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
singleApi: 'http://api-test3.yohops.com:9999/'
api: 'http://api-test3.dev.yohocorp.com/',
service: 'http://api-test3.dev.yohocorp.com/',
singleApi: 'http://api-test3.dev.yohocorp.com/'
// api: 'http://dev-api.yohops.com:9999/',
// service: 'http://dev-service.yohops.com:9999/',
... ... @@ -203,9 +203,9 @@ if (isProduction) {
Object.assign(module.exports, {
appName: 'm.yohoblk.com for test',
domains: {
api: process.env.TEST_API || 'http://api-test1.yohops.com:9999/',
service: process.env.TEST_SERVICE || 'http://service-test1.yohops.com:9999/',
singleApi: process.env.TEST_SINGLE || 'http://api-test1.yohops.com:9999/'
api: process.env.TEST_API || 'http://api-test3.dev.yohocorp.com/',
service: process.env.TEST_SERVICE || 'http://api-test3.dev.yohocorp.com/',
singleApi: process.env.TEST_SINGLE || 'http://api-test3.dev.yohocorp.com/'
},
useOneapm: true,
useCache: true
... ...
... ... @@ -57,7 +57,7 @@ exports.createApp = async (app) => {
res.status(200).end();
});
app.use(favicon(path.join(__dirname, '/public/favicon.ico')));
app.use(favicon(path.join(__dirname, '/favicon.ico')));
app.use(express.static(path.join(__dirname, 'public')));
// 添加请求上下文
... ...
#!/bin/bash
wordir=$2
needBuild=$1
cd $wordir
rm -rf yoho-blk-wap.tar.gz
yarn
if [[ $1 == "TEST1" ]] || [[ $1 == "TEST2" ]] || [[ $1 == "TEST3" ]]
then
yarn build
yarn --production=false
if [ "$needBuild" == "YES" ];then
yarn build
fi
tar -czvf yoho-blk-wap.tar.gz *
yarn build:node --build=$needBuild
/usr/local/bin/node-prune ./dist/node/node_modules
... ...
... ... @@ -44,7 +44,7 @@ const routes = [
const isDev = process.env.NODE_ENV === 'development' || !process.env.NODE_ENV;
let renderer;
let template = fs.readFileSync(path.join(__dirname, '../../src/index.html'), 'utf-8');
let template = fs.readFileSync(path.join(__dirname, '../../index.html'), 'utf-8');
const microCache = LRU({ // eslint-disable-line
max: 1000,
... ...
No preview for this file type
{}
\ No newline at end of file
... ...
... ... @@ -14,6 +14,7 @@
"server": "NODE_ENV=production webpack --config ./build/webpack.server.conf.js",
"static": "webpack-dev-server --config ./public/build/webpack.dev.config.js",
"build": "NODE_ENV=production webpack --config ./public/build/webpack.prod.config.js && node ./build/build.js",
"build:node": "node ./build/node-build.js",
"performance": "NODE_ENV=performance webpack --config ./public/build/webpack.prod.config.js",
"online": "NODE_ENV=\"production\" node app.js",
"debug": "DEBUG=\"express:*\" nodemon -e js,hbs -i public/ app.js",
... ... @@ -48,20 +49,20 @@
"request-promise": "^4.2.1",
"serve-favicon": "^2.3.0",
"uuid": "^2.0.2",
"vue": "^2.5.13",
"vue": "=2.5.13",
"vue-awesome-swiper": "^3.0.6",
"vue-hot-reload-api": "^1.2.0",
"vue-html-loader": "^1.2.4",
"vue-infinite-scroll": "^2.0.1",
"vue-lazyload": "^1.0.6",
"vue-loader": "^13.7.0",
"vue-router": "^3.0.1",
"vue-server-renderer": "^2.5.13",
"vue-loader": "=13.7.0",
"vue-router": "=3.0.1",
"vue-server-renderer": "=2.5.13",
"vue-style-loader": "^3.0.3",
"vue-swipe": "^2.0.3",
"vue-template-compiler": "^2.5.13",
"vue-touch": "2.0.0-beta.3",
"vuex": "^3.0.1",
"vuex": "=3.0.1",
"winston": "^2.2.0",
"yoho-cookie": "1.2.0",
"yoho-jquery": "^2.2.4",
... ... @@ -102,7 +103,7 @@
"jquery": "2.2.4",
"memory-fs": "^0.4.1",
"node-sass": "^4.5.3",
"nodemon": "^1.10.2",
"nodemon": "^1.17.5",
"postcss-assets": "^4.1.0",
"postcss-cachebuster": "^0.1.3",
"postcss-calc": "^5.3.1",
... ... @@ -131,7 +132,7 @@
"webpack-bundle-analyzer": "^2.9.1",
"webpack-dashboard": "^0.1.8",
"webpack-dev-middleware": "^1.12.0",
"webpack-dev-server": "^2.6.1",
"webpack-dev-server": "^3.1.4",
"webpack-hot-middleware": "^2.18.2",
"webpack-merge": "^4.1.0",
"webpack-node-externals": "^1.6.0",
... ...
... ... @@ -5,7 +5,7 @@ const UglifyJsParallelPlugin = require('webpack-uglify-parallel');
const os = require('os');
const pkg = require('../../package.json');
const path = require('path');
const distDir = path.join(__dirname, `../dist/${pkg.name}`);
const distDir = path.join(__dirname, `../../dist/${pkg.name}`);
let base = require('./webpack.base.config');
... ...
This diff could not be displayed because it is too large.