From 9b54ebe746c69fc57ed1a865eb07a1e5c9a35389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=A8=E5=AD=90=E6=9D=8E=C2=B7De?= Date: Wed, 13 Apr 2022 11:45:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=89=93=E5=8C=85=E5=88=B0?= =?UTF-8?q?=E7=A7=81=E6=9C=8D=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build/index.js | 86 ++++++++++++++++++++++ build/pom.xml | 192 +++++++++++++++++++++++++++++++++++++++++++++++++ deploy.sh | 34 +++++++++ 3 files changed, 312 insertions(+) create mode 100644 build/index.js create mode 100644 build/pom.xml create mode 100644 deploy.sh diff --git a/build/index.js b/build/index.js new file mode 100644 index 00000000..af5695c5 --- /dev/null +++ b/build/index.js @@ -0,0 +1,86 @@ +'use strict' +// Template version: 1.2.6 +// see http://vuejs-templates.github.io/webpack for documentation. + +const path = require('path') + +module.exports = { + dev: { + // Paths + assetsSubDirectory: 'static', + assetsPublicPath: '/', + proxyTable: {}, + + // Various Dev Server settings + host: 'localhost', // can be overwritten by process.env.HOST + port: 9528, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined + autoOpenBrowser: true, + errorOverlay: true, + notifyOnErrors: false, + poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions- + + // Use Eslint Loader? + // If true, your code will be linted during bundling and + // linting errors and warnings will be shown in the console. + useEslint: true, + // If true, eslint errors and warnings will also be shown in the error overlay + // in the browser. + showEslintErrorsInOverlay: false, + + /** + * Source Maps + */ + + // https://webpack.js.org/configuration/devtool/#development + devtool: 'cheap-source-map', + + // CSS Sourcemaps off by default because relative paths are "buggy" + // with this option, according to the CSS-Loader README + // (https://github.com/webpack/css-loader#sourcemaps) + // In our experience, they generally work as expected, + // just be aware of this issue when enabling this option. + cssSourceMap: false + }, + + build: { + // Template for index.html + index: path.resolve(__dirname, '../dist/index.html'), + + // Paths + assetsRoot: path.resolve(__dirname, '../dist'), + assetsSubDirectory: 'static', + + /** + * You can set by youself according to actual condition + * You will need to set this if you plan to deploy your site under a sub path, + * for example GitHub pages. If you plan to deploy your site to https://foo.github.io/bar/, + * then assetsPublicPath should be set to "/bar/". + * In most cases please use '/' !!! + */ + assetsPublicPath: '/report/', + + /** + * Source Maps + */ + + productionSourceMap: false, + // https://webpack.js.org/configuration/devtool/#production + devtool: 'source-map', + + // Gzip off by default as many popular static hosts such as + // Surge or Netlify already gzip all static assets for you. + // Before setting to `true`, make sure to: + // npm install --save-dev compression-webpack-plugin + productionGzip: false, + productionGzipExtensions: ['js', 'css'], + + // Run the build command with an extra argument to + // View the bundle analyzer report after build finishes: + // `npm run build --report` + // Set to `true` or `false` to always turn it on or off + bundleAnalyzerReport: process.env.npm_config_report || false, + + // `npm run build:prod --generate_report` + generateAnalyzerReport: process.env.npm_config_generate_report || false + } +} diff --git a/build/pom.xml b/build/pom.xml new file mode 100644 index 00000000..14339990 --- /dev/null +++ b/build/pom.xml @@ -0,0 +1,192 @@ + + + + + org.springframework.boot + spring-boot-starter-parent + 2.3.5.RELEASE + + + + 4.0.0 + + com.anji-plus + product-report-starter + 1.2.0-SNAPSHOT + + + UTF-8 + -Xdoclint:none + 1.8 + 1.8 + true + + + + + + org.springframework.boot + spring-boot-starter-web + + + org.apache.logging.log4j + log4j-to-slf4j + + + + + + org.apache.logging.log4j + log4j-to-slf4j + 2.15.0 + + + + org.apache.logging.log4j + log4j-api + 2.15.0 + + + + + org.springframework.boot + spring-boot-starter-cache + + + + org.springframework.boot + spring-boot-starter-test + test + + + + org.springframework.cloud + spring-cloud-context + 2.2.6.RELEASE + + + + org.springframework.boot + spring-boot-configuration-processor + true + + + + com.anji-plus + spring-boot-gaea + 2.0.3.RELEASE + + + org.springframework.boot + spring-boot-starter-data-redis + + + + + + com.baomidou + mybatis-plus-boot-starter + 3.3.2 + + + + mysql + mysql-connector-java + + + com.alibaba + druid + 1.2.0 + + + org.flywaydb + flyway-core + 5.2.1 + + + + net.sf.ehcache + ehcache + 2.10.6 + + + + org.apache.httpcomponents + httpclient + 4.5.10 + + + + org.projectlombok + lombok + 1.18.10 + true + + + + com.itextpdf + itextpdf + 5.5.13.2 + + + com.itextpdf + itext-asian + 5.2.0 + + + + org.apache.poi + poi + 4.1.2 + + + org.apache.poi + poi-ooxml + 4.1.2 + + + org.apache.poi + poi-ooxml-schemas + 4.1.2 + + + + org.codehaus.groovy + groovy + 3.0.9 + + + + + + + + + + + nexus + nexus + http://10.108.10.53:8081/repository/maven-public/ + + true + + + true + always + + + + + + + + nexus-releases + http://10.108.10.53:8081/repository/maven-releases/ + + + nexus-snapshots + http://10.108.10.53:8081/repository/maven-snapshots/ + + + diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 00000000..f9e63d8a --- /dev/null +++ b/deploy.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +#该脚本为私有化脚本,打包成内含网页的product-report-starter放在内网私服 + +#判断node.js mvn是否存在 +command -v npm >/dev/null 2>&1 || { echo >&2 "I require node.js v14.16.0+ but it's not installed. Aborting."; sleep 5; exit 1; } +command -v mvn >/dev/null 2>&1 || { echo >&2 "I require maven 3.5 + but it's not installed. Aborting."; sleep 5; exit 1; } + +cd `dirname $0` +BuildDir=`pwd` #工程根目录 + +#重置pom和index.js +cat $BuildDir/build/index.js > $BuildDir/report-ui/config/index.js +cat $BuildDir/build/pom.xml > $BuildDir/report-core/pom.xml + +echo "build web" +cd $BuildDir/report-ui +rm -rf dist +npm install >/dev/null 2>&1 +npm run build:prod + +echo "publish web to springboot src/main/resources/static" +rm -rf $BuildDir/report-core/src/main/resources/static +mkdir -p $BuildDir/report-core/src/main/resources/static +mv $BuildDir/report-ui/dist/* $BuildDir/report-core/src/main/resources/static/ + + +echo "build springboot" +cd $BuildDir/report-core +mvn clean deploy -Dmaven.test.skip=true + + +rm -rf $BuildDir/report-core/src/main/resources/static +git reset --hard \ No newline at end of file