|
@@ -1,74 +1,73 @@
|
|
|
kind: pipeline
|
|
|
-name: default
|
|
|
+name: 数据报告-构建
|
|
|
|
|
|
steps:
|
|
|
- - name: restore-cache
|
|
|
- image: drillster/drone-volume-cache
|
|
|
- volumes:
|
|
|
- - name: cache
|
|
|
- path: /cache
|
|
|
- settings:
|
|
|
- restore: true
|
|
|
- mount:
|
|
|
- - ./node_modules
|
|
|
-
|
|
|
+ # 环境依赖相关
|
|
|
- name: npm-install
|
|
|
- image: node:10.21.0
|
|
|
+ pull: if-not-exists
|
|
|
+ image: node:lts
|
|
|
commands:
|
|
|
- - echo Running check
|
|
|
- echo Use yarn management node_modules
|
|
|
- npm config set registry https://registry.npm.taobao.org --global
|
|
|
- npm config set disturl https://npm.taobao.org/dist --global
|
|
|
- npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass
|
|
|
- - npm install yarn
|
|
|
+ - npm install yarn -D
|
|
|
- yarn config set registry https://registry.npm.taobao.org --global
|
|
|
- yarn config set disturl https://npm.taobao.org/dist --global
|
|
|
- yarn config set sass_binary_site https://npm.taobao.org/mirrors/node-sass
|
|
|
- - yarn
|
|
|
-
|
|
|
- - name: rebuild-cache
|
|
|
- image: drillster/drone-volume-cache
|
|
|
- volumes:
|
|
|
- - name: cache
|
|
|
- path: /cache
|
|
|
- settings:
|
|
|
- rebuild: true
|
|
|
- mount:
|
|
|
- - ./node_modules
|
|
|
-
|
|
|
-
|
|
|
+ - yarn install --prefer-offline
|
|
|
+ # 质量相关
|
|
|
- name: lint-code
|
|
|
- image: node:10.21.0
|
|
|
+ pull: if-not-exists
|
|
|
+ image: node:lts
|
|
|
+ failure: ignore
|
|
|
commands:
|
|
|
- npm run lint
|
|
|
-
|
|
|
+ # 编译相关
|
|
|
- name: build-code
|
|
|
- image: node:10.21.0
|
|
|
+ pull: if-not-exists
|
|
|
+ image: node:lts
|
|
|
commands:
|
|
|
- - npm -v
|
|
|
- - node -v
|
|
|
- - npm run build
|
|
|
- - npm run replace
|
|
|
- - pwd
|
|
|
- - ls -l
|
|
|
-
|
|
|
- - name: scp-code
|
|
|
- image: appleboy/drone-scp
|
|
|
+ - npm run build:ci
|
|
|
+ # 部署相关
|
|
|
+ # 压缩
|
|
|
+ - name: zip
|
|
|
+ pull: if-not-exists
|
|
|
+ image: alpine
|
|
|
+ commands:
|
|
|
+ - tar -cvf dist-datareport.tar ./dist-version
|
|
|
+ # 邮件
|
|
|
+ - name: notify
|
|
|
+ pull: if-not-exists
|
|
|
+ image: drillster/drone-email
|
|
|
settings:
|
|
|
- host:
|
|
|
- from_secret: ssh_host
|
|
|
+ host: smtp.exmail.qq.com
|
|
|
+ port: 465
|
|
|
username:
|
|
|
- from_secret: ssh_user
|
|
|
- port: 22
|
|
|
+ from_secret: email_username
|
|
|
password:
|
|
|
- from_secret: ssh_password
|
|
|
- target:
|
|
|
- from_secret: ssh_remote_dir
|
|
|
- source:
|
|
|
- - datareport
|
|
|
+ from_secret: email_password
|
|
|
+ from: zhangyuhan@topnet.net.cn
|
|
|
+ recipients:
|
|
|
+ - zhangyuhan@topnet.net.cn
|
|
|
+ attachment: dist-datareport.tar
|
|
|
+ # 回推Git
|
|
|
+ - name: push-commit
|
|
|
+ pull: if-not-exists
|
|
|
+ image: appleboy/drone-git-push
|
|
|
+ settings:
|
|
|
+ ssh_key:
|
|
|
+ from_secret: ssh_key
|
|
|
+ remote:
|
|
|
+ from_secret: git_remote
|
|
|
+ branch: dev1.4
|
|
|
+ force: false
|
|
|
+ commit: true
|
|
|
+
|
|
|
|
|
|
-#
|
|
|
+# # 钉钉通知
|
|
|
# - name: notification-success
|
|
|
+# pull: if-not-exists
|
|
|
# image: lddsb/drone-dingtalk-message
|
|
|
# settings:
|
|
|
# token:
|
|
@@ -76,15 +75,14 @@ steps:
|
|
|
# secret:
|
|
|
# from_secret: ding-secret-for-generate-sign
|
|
|
# type: markdown
|
|
|
-# tpl: ./ding.md
|
|
|
-# tips_title: '滴滴'
|
|
|
+# tpl: ./ding-build.md
|
|
|
+# tips_title: '滴滴,编译打包成功'
|
|
|
# success_color: "008000"
|
|
|
-# success_pic: "https://raw.githubusercontent.com/Ethan-Liuu/picture/master/success.png"
|
|
|
# when:
|
|
|
# status:
|
|
|
# - success
|
|
|
-#
|
|
|
# - name: notification-failure
|
|
|
+# pull: if-not-exists
|
|
|
# image: lddsb/drone-dingtalk-message
|
|
|
# settings:
|
|
|
# token:
|
|
@@ -92,16 +90,15 @@ steps:
|
|
|
# secret:
|
|
|
# from_secret: ding-secret-for-generate-sign
|
|
|
# type: markdown
|
|
|
-# tpl: ./ding.md
|
|
|
-# tips_title: '滴滴'
|
|
|
+# tpl: ./ding-build.md
|
|
|
+# tips_title: 'Error, 编译打包错误待处理'
|
|
|
# success_color: "FF0000"
|
|
|
-# success_pic: "https://raw.githubusercontent.com/Ethan-Liuu/picture/master/failed.png"
|
|
|
# when:
|
|
|
# status:
|
|
|
# - failure
|
|
|
|
|
|
+trigger:
|
|
|
+ event:
|
|
|
+ include:
|
|
|
+ - tag
|
|
|
|
|
|
-volumes:
|
|
|
- - name: cache
|
|
|
- host:
|
|
|
- path: /home/parallels/Desktop/cache
|