Browse Source

feat: 测试secrets使用

master
niushuai233 2 years ago
parent
commit
821ef1b849
  1. 6
      .drone.yml
  2. 2
      .env.production

6
.drone.yml

@ -34,6 +34,9 @@ steps:
# node install # node install
- name: node-package - name: node-package
image: niushuai233/node-cnpm:16.17.1 image: niushuai233/node-cnpm:16.17.1
environment:
PROD_API_URL:
from_secret: PROD_API_URL
volumes: volumes:
- name: node-cache - name: node-cache
path: /node_cache path: /node_cache
@ -42,6 +45,9 @@ steps:
commands: commands:
- echo 'node package start' - echo 'node package start'
- ls -alh - ls -alh
- echo $PROD_API_URL
- sed -i "s#PROD_API_URL#$PROD_API_URL#g" .env.production
- cat .env.production
# 打包 # 打包
- npm config set registry https://registry.npm.taobao.org - npm config set registry https://registry.npm.taobao.org
- npm config set cache /node_cache --global - npm config set cache /node_cache --global

2
.env.production

@ -1,4 +1,4 @@
NODE_ENV=production NODE_ENV=production
VUE_APP_API_BASE_URL=http://localhost:8080/prodApi VUE_APP_API_BASE_URL=PROD_API_URL
VUE_APP_CAS_BASE_URL=http:///cas VUE_APP_CAS_BASE_URL=http:///cas
VUE_APP_ONLINE_BASE_URL=http:///onlinePreview VUE_APP_ONLINE_BASE_URL=http:///onlinePreview
Loading…
Cancel
Save