build:preview
Former-commit-id: a15d2e58d9
Former-commit-id: ebfe59a4d26fb025d35cdc1aeb950681a1c21aa1
Former-commit-id: bbb06ef0ab554f44320ec0775ce93731c3563626
Former-commit-id: bf87aa7c70b632e52f3d20a10afcd1427858f94f [formerly 52146f15099694bff9a7211c538ce83dc185c599]
Former-commit-id: 0e976f7b13d707a015b7c89a04c5dfbbd099d29c
Former-commit-id: 82a4a0506d806af6dc2757ccf485aab9e5e5f3ee
Former-commit-id: 2c3c94b0f7b1f87e48e1216b23ee91c7c3f717c6
Former-commit-id: 5d98af7658f3134a350681b0182b97753eaa4ddb
Former-commit-id: 30309394129fb1dc2c28c4780881147254a81e3b
This commit is contained in:
parent
6f62bea976
commit
bc8de99619
10
.env.netlify
10
.env.netlify
|
|
@ -1,10 +0,0 @@
|
|||
# travis
|
||||
|
||||
# 指定构建模式
|
||||
NODE_ENV=production
|
||||
|
||||
# 标记当前构建方式
|
||||
VUE_APP_BUILD_MODE=NETLIFY
|
||||
|
||||
# 显示源码按钮
|
||||
VUE_APP_SCOURCE_LINK=TRUE
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
# travis
|
||||
# 构建预览页面
|
||||
|
||||
# 指定构建模式
|
||||
NODE_ENV=production
|
||||
|
||||
# 标记当前构建方式
|
||||
VUE_APP_BUILD_MODE=TRAVIS
|
||||
VUE_APP_BUILD_MODE=PREVIEW
|
||||
|
||||
# 显示源码按钮
|
||||
VUE_APP_SCOURCE_LINK=TRUE
|
||||
|
|
@ -16,7 +16,7 @@ jobs:
|
|||
- name: Build
|
||||
run: |
|
||||
npm install
|
||||
npm run build:github
|
||||
npm run build:preview
|
||||
- name: Deploy
|
||||
uses: SamKirkland/FTP-Deploy-Action@2.0.0
|
||||
env:
|
||||
|
|
|
|||
25
.travis.yml
25
.travis.yml
|
|
@ -1,25 +0,0 @@
|
|||
language: node_js
|
||||
node_js: stable
|
||||
|
||||
notifications:
|
||||
webhooks: https://oapi.dingtalk.com/robot/send?access_token=a0918ec1b0461056fb9953fe2b03ecc3074a629e88992f327cc94bae93349e9e
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- "node_modules"
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
script:
|
||||
- yarn run build:travis
|
||||
|
||||
before_install:
|
||||
- curl -o- -L https://yarnpkg.com/install.sh | bash
|
||||
- export PATH=$HOME/.yarn/bin:$PATH
|
||||
|
||||
after_success:
|
||||
- ./deploy/qshell account $AK $SK liyang
|
||||
- ./deploy/qshell qupload ./deploy/upload.conf
|
||||
- ./deploy/qshell cdnrefresh --dirs -i ./deploy/cdnrefresh.txt
|
||||
|
|
@ -17,9 +17,6 @@
|
|||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://www.travis-ci.org/d2-projects/d2-admin">
|
||||
<img src="https://www.travis-ci.org/d2-projects/d2-admin.svg?branch=master"/>
|
||||
</a>
|
||||
<a href="https://app.netlify.com/sites/d2-admin/deploys">
|
||||
<img src="https://api.netlify.com/api/v1/badges/a5dd4bbd-da3f-4145-98a9-8012577bdcf5/deploy-status"/>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -17,9 +17,6 @@
|
|||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://www.travis-ci.org/d2-projects/d2-admin">
|
||||
<img src="https://www.travis-ci.org/d2-projects/d2-admin.svg?branch=master"/>
|
||||
</a>
|
||||
<a href="https://app.netlify.com/sites/d2-admin/deploys">
|
||||
<img src="https://api.netlify.com/api/v1/badges/a5dd4bbd-da3f-4145-98a9-8012577bdcf5/deploy-status"/>
|
||||
</a>
|
||||
|
|
|
|||
|
|
@ -3,12 +3,10 @@
|
|||
"version": "1.7.2",
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve --open",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint --fix",
|
||||
"build:netlify": "vue-cli-service build --mode netlify",
|
||||
"build": "vue-cli-service build",
|
||||
"build:nomock": "vue-cli-service build --mode nomock",
|
||||
"build:travis": "vue-cli-service build --mode travis",
|
||||
"build:github": "NODE_OPTIONS=--max_old_space_size=4096 npm run build:travis",
|
||||
"build:preview": "NODE_OPTIONS=--max_old_space_size=4096 vue-cli-service build --mode preview",
|
||||
"dev": "npm run serve",
|
||||
"i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'",
|
||||
"start": "npm run serve",
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ export default {
|
|||
onChangeLocale (command) {
|
||||
this.$i18n.locale = command
|
||||
let message = `当前语言:${this.$t('_name')} [ ${this.$i18n.locale} ]`
|
||||
if (['TRAVIS', 'NETLIFY'].includes(process.env.VUE_APP_BUILD_MODE)) {
|
||||
if (process.env.VUE_APP_BUILD_MODE === 'PREVIEW') {
|
||||
message = [
|
||||
`当前语言:${this.$t('_name')} [ ${this.$i18n.locale} ]`,
|
||||
`仅提供切换功能,没有配置具体的语言数据 `,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
<a><img src="https://img.shields.io/github/issues-pr-closed/d2-projects/d2-admin.svg"/></a>
|
||||
</p>
|
||||
<p align="center">
|
||||
<a href="https://www.travis-ci.org/d2-projects/d2-admin"><img src="https://www.travis-ci.org/d2-projects/d2-admin.svg?branch=master"/></a>
|
||||
<a><img src="https://img.shields.io/github/last-commit/d2-projects/d2-admin.svg"/></a>
|
||||
<a><img src="https://img.shields.io/badge/code_style-standard-brightgreen.svg"/></a>
|
||||
<a><img src="https://api.netlify.com/api/v1/badges/a5dd4bbd-da3f-4145-98a9-8012577bdcf5/deploy-status"/></a>
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ module.exports = {
|
|||
// sourcemap不包含列信息
|
||||
config => config.devtool('cheap-source-map')
|
||||
)
|
||||
// TRAVIS 构建 vue-loader 添加 filename
|
||||
// 预览环境构建 vue-loader 添加 filename
|
||||
.when(process.env.VUE_APP_SCOURCE_LINK === 'TRUE',
|
||||
VueFilenameInjector(config, {
|
||||
propName: process.env.VUE_APP_SOURCE_VIEWER_PROP_NAME
|
||||
|
|
|
|||
Loading…
Reference in New Issue