|
@ -3,6 +3,22 @@ kind: pipeline |
|
|
type: docker |
|
|
type: docker |
|
|
name: development |
|
|
name: development |
|
|
|
|
|
|
|
|
|
|
|
# 常量值 |
|
|
|
|
|
constants: |
|
|
|
|
|
- &DEVELOPMENT_HOST test.tall.wiki |
|
|
|
|
|
- &DEVELOPMENT_CMD |
|
|
|
|
|
- npm config set registry http://registry.npm.taobao.org |
|
|
|
|
|
- npm i |
|
|
|
|
|
- npm run build:test |
|
|
|
|
|
- &DEVELOPMENT_SCP_TARGET /home/checkwork |
|
|
|
|
|
- &DEVELOPMENT_PORT 22 |
|
|
|
|
|
- &DEVELOPMENT_NODE_VERSION node:16 |
|
|
|
|
|
- &DEVELOPMENT_BRANCH develop |
|
|
|
|
|
- &DEVELOPMENT_SCP_SOURCE dist/* |
|
|
|
|
|
- &SCP_STRIP_DIR_LEVEL 1 |
|
|
|
|
|
- &NOTIFY_WECHATROBOT_WEBHOOK https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=428e5c5d-f992-4349-939d-9c99556e50b8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 挂载的主机卷,可以映射到docker容器中 |
|
|
# 挂载的主机卷,可以映射到docker容器中 |
|
|
volumes: |
|
|
volumes: |
|
|
# maven构建缓存(宿主机目录) |
|
|
# maven构建缓存(宿主机目录) |
|
@ -28,15 +44,12 @@ steps: |
|
|
- ./node_modules |
|
|
- ./node_modules |
|
|
|
|
|
|
|
|
- name: build |
|
|
- name: build |
|
|
image: node:16 |
|
|
image: *DEVELOPMENT_NODE_VERSION |
|
|
pull: if-not-exists # default always |
|
|
pull: if-not-exists # default always |
|
|
# volumes: |
|
|
# volumes: |
|
|
# - name: cache |
|
|
# - name: cache |
|
|
# path: /root/.m2 |
|
|
# path: /root/.m2 |
|
|
commands: |
|
|
commands: *DEVELOPMENT_CMD |
|
|
- npm config set registry http://registry.npm.taobao.org |
|
|
|
|
|
- npm i |
|
|
|
|
|
- npm run build:test |
|
|
|
|
|
|
|
|
|
|
|
- name: rebuild-cache |
|
|
- name: rebuild-cache |
|
|
image: drillster/drone-volume-cache |
|
|
image: drillster/drone-volume-cache |
|
@ -55,20 +68,20 @@ steps: |
|
|
- name: ssh_key |
|
|
- name: ssh_key |
|
|
path: /root/.ssh/ |
|
|
path: /root/.ssh/ |
|
|
settings: |
|
|
settings: |
|
|
host: test.tall.wiki |
|
|
host: *DEVELOPMENT_HOST |
|
|
port: 22 |
|
|
port: *DEVELOPMENT_PORT |
|
|
username: root |
|
|
username: root |
|
|
key_path: /root/.ssh/id_rsa |
|
|
key_path: /root/.ssh/id_rsa |
|
|
rm: true # true则会删除目标目录重建 |
|
|
rm: true # true则会删除目标目录重建 |
|
|
target: /home/checkwork |
|
|
target: *DEVELOPMENT_SCP_TARGET |
|
|
source: dist/* |
|
|
source: *DEVELOPMENT_SCP_SOURCE |
|
|
strip_components: 1 # 去除的目录层数,如果没有该选项,则拷贝过去是 target/xxx.jar,1代表去除target |
|
|
strip_components: 1 # 去除的目录层数,如果没有该选项,则拷贝过去是 target/xxx.jar,1代表去除target |
|
|
|
|
|
|
|
|
- name: notify-wechatwork |
|
|
- name: notify-wechatwork |
|
|
image: fifsky/drone-wechat-work |
|
|
image: fifsky/drone-wechat-work |
|
|
pull: if-not-exists |
|
|
pull: if-not-exists |
|
|
settings: |
|
|
settings: |
|
|
url: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=428e5c5d-f992-4349-939d-9c99556e50b8 |
|
|
url: *NOTIFY_WECHATROBOT_WEBHOOK |
|
|
msgtype: markdown |
|
|
msgtype: markdown |
|
|
content: | |
|
|
content: | |
|
|
{{if eq .Status "success" }} |
|
|
{{if eq .Status "success" }} |
|
@ -90,13 +103,28 @@ steps: |
|
|
|
|
|
|
|
|
trigger: |
|
|
trigger: |
|
|
branch: |
|
|
branch: |
|
|
- develop |
|
|
- *DEVELOPMENT_BRANCH |
|
|
|
|
|
|
|
|
--- |
|
|
--- |
|
|
kind: pipeline |
|
|
kind: pipeline |
|
|
type: docker |
|
|
type: docker |
|
|
name: production |
|
|
name: production |
|
|
|
|
|
|
|
|
|
|
|
# 常量值 |
|
|
|
|
|
constants: |
|
|
|
|
|
- &PRODUCTION_HOST www.tall.wiki |
|
|
|
|
|
- &PRODUCTION_CMD |
|
|
|
|
|
- npm config set registry http://registry.npm.taobao.org |
|
|
|
|
|
- npm i |
|
|
|
|
|
- npm run build |
|
|
|
|
|
- &PRODUCTION_SCP_TARGET /home/checkwork |
|
|
|
|
|
- &PRODUCTION_BRANCH master |
|
|
|
|
|
- &PRODUCTION_PORT 22 |
|
|
|
|
|
- &PRODUCTION_NODE_VERSION node:16 |
|
|
|
|
|
- &PRODUCTION_SCP_SOURCE dist/* |
|
|
|
|
|
- &SCP_STRIP_DIR_LEVEL 1 |
|
|
|
|
|
- &NOTIFY_WECHATROBOT_WEBHOOK https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=428e5c5d-f992-4349-939d-9c99556e50b8 |
|
|
|
|
|
|
|
|
# 挂载的主机卷,可以映射到docker容器中 |
|
|
# 挂载的主机卷,可以映射到docker容器中 |
|
|
volumes: |
|
|
volumes: |
|
|
# maven构建缓存(宿主机目录) |
|
|
# maven构建缓存(宿主机目录) |
|
@ -122,15 +150,12 @@ steps: |
|
|
- ./node_modules |
|
|
- ./node_modules |
|
|
|
|
|
|
|
|
- name: build |
|
|
- name: build |
|
|
image: node:16 |
|
|
image: *PRODUCTION_NODE_VERSION |
|
|
pull: if-not-exists # default always |
|
|
pull: if-not-exists # default always |
|
|
# volumes: |
|
|
# volumes: |
|
|
# - name: cache |
|
|
# - name: cache |
|
|
# path: /root/.m2 |
|
|
# path: /root/.m2 |
|
|
commands: |
|
|
commands: *PRODUCTION_CMD |
|
|
- npm config set registry http://registry.npm.taobao.org |
|
|
|
|
|
- npm i |
|
|
|
|
|
- npm run build |
|
|
|
|
|
|
|
|
|
|
|
- name: rebuild-cache |
|
|
- name: rebuild-cache |
|
|
image: drillster/drone-volume-cache |
|
|
image: drillster/drone-volume-cache |
|
@ -149,20 +174,20 @@ steps: |
|
|
- name: ssh_key |
|
|
- name: ssh_key |
|
|
path: /root/.ssh/ |
|
|
path: /root/.ssh/ |
|
|
settings: |
|
|
settings: |
|
|
host: www.tall.wiki |
|
|
host: *PRODUCTION_HOST |
|
|
port: 22 |
|
|
port: *PRODUCTION_PORT |
|
|
username: root |
|
|
username: root |
|
|
key_path: /root/.ssh/id_rsa |
|
|
key_path: /root/.ssh/id_rsa |
|
|
rm: true # true则会删除目标目录重建 |
|
|
rm: true # true则会删除目标目录重建 |
|
|
target: /home/checkwork |
|
|
target: *PRODUCTION_SCP_TARGET |
|
|
source: dist/* |
|
|
source: *PRODUCTION_SCP_SOURCE |
|
|
strip_components: 1 # 去除的目录层数,如果没有该选项,则拷贝过去是 target/xxx.jar,1代表去除target |
|
|
strip_components: 1 # 去除的目录层数,如果没有该选项,则拷贝过去是 target/xxx.jar,1代表去除target |
|
|
|
|
|
|
|
|
- name: notify-wechatwork |
|
|
- name: notify-wechatwork |
|
|
image: fifsky/drone-wechat-work |
|
|
image: fifsky/drone-wechat-work |
|
|
pull: if-not-exists |
|
|
pull: if-not-exists |
|
|
settings: |
|
|
settings: |
|
|
url: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=428e5c5d-f992-4349-939d-9c99556e50b8 |
|
|
url: NOTIFY_WECHATROBOT_WEBHOOK |
|
|
msgtype: markdown |
|
|
msgtype: markdown |
|
|
content: | |
|
|
content: | |
|
|
{{if eq .Status "success" }} |
|
|
{{if eq .Status "success" }} |
|
@ -184,4 +209,4 @@ steps: |
|
|
|
|
|
|
|
|
trigger: |
|
|
trigger: |
|
|
branch: |
|
|
branch: |
|
|
- master |
|
|
- *PRODUCTION_BRANCH |
|
|