Skip to content
Permalink
Browse files

fix(cd): fix trigger in cd pipeline

  • Loading branch information...
hanxiao committed Sep 27, 2019
1 parent fdc38d5 commit ccf4efc8897e4ab8ce144601f5cf63b0ab8924b0
Showing with 34 additions and 100 deletions.
  1. +34 −100 .drone-cd.yml
@@ -54,49 +54,15 @@ steps:
- export MSG_CONTENT=""
- ./shell/push-wechatwork.sh

- name: notify the failure on wechat work
image: byrnedo/alpine-curl
environment:
BOT_URL:
from_secret: BOT_URL
commands:
- export MSG_LINK=$DRONE_BUILD_LINK
- export MSG_TITLE="❌🎁 fail to build docker image!"
- export MSG_CONTENT="please inform [$DRONE_COMMIT_AUTHOR]($DRONE_COMMIT_AUTHOR_EMAIL) to modify and fix [\`$DRONE_SOURCE_BRANCH\`]($DRONE_COMMIT_LINK). click the link below to see the details."
- ./shell/push-wechatwork.sh
when:
status:
- failure

trigger:
branch:
- master
event:
- push

volumes:
- name: docker
host:
path: /var/run/docker.sock

---

kind: pipeline
name: release-docker-build

clone:
depth: 50

steps:
- name: notify the start on wechat work
- name: notify the start on benchmark work
image: byrnedo/alpine-curl
environment:
BOT_URL:
from_secret: BOT_URL
commands:
- export MSG_LINK=$DRONE_BUILD_LINK
- export MSG_TITLE="⌛🗳 Start to build docker image for new release \`$DRONE_SOURCE_BRANCH\`(\`${DRONE_TAG}\`)"
- export MSG_CONTENT="[tag link](https://github.com/gnes-ai/gnes/tree/${DRONE_TAG}), click the link below to see the status"
- export MSG_LINK=${DRONE_BUILD_LINK}
- export MSG_TITLE="🏎️🐎 Start to benchmark the new master \`$DRONE_SOURCE_BRANCH\`(\`${DRONE_BUILD_NUMBER}\`)"
- export MSG_CONTENT="click the link below to see the status"
- ./shell/push-wechatwork.sh

- name: build and push docker images
@@ -105,6 +71,8 @@ steps:
volumes:
- name: docker
path: /var/run/docker.sock
- name: cache
path: /workspace
environment:
TCLOUD_USER:
from_secret: TCLOUD_USER
@@ -122,17 +90,22 @@ steps:
from_secret: GITHUB_USER
GITHUB_PWD:
from_secret: GITHUB_PWD
DO_BENCHMARK:
from_secret: DO_BENCHMARK
BENCHMARK_DIR: /workspace/benchmark/
SHARED_HOST_PATH: /tmp/
commands:
- ./docker-build.sh
- ./benchmark-eval.sh
- docker system prune -a -f

- name: notify the sucess on wechat work
image: byrnedo/alpine-curl
environment:
BOT_URL:
from_secret: BOT_URL
commands:
- export MSG_LINK="https://github.com/gnes-ai/gnes/tree/${DRONE_TAG}"
- export MSG_TITLE="✅🎁 All images are successfully delivered!"
- export MSG_LINK="https://github.com/gnes-ai/benchmark"
- export MSG_TITLE="✅🏍️ New benchmark is updated!"
- export MSG_CONTENT=""
- ./shell/push-wechatwork.sh

@@ -143,29 +116,34 @@ steps:
from_secret: BOT_URL
commands:
- export MSG_LINK=$DRONE_BUILD_LINK
- export MSG_TITLE="❌🎁 fail to build docker image!"
- export MSG_CONTENT="[tag link](https://github.com/gnes-ai/gnes/tree/${DRONE_TAG}) please inform [$DRONE_COMMIT_AUTHOR]($DRONE_COMMIT_AUTHOR_EMAIL) to modify and fix [\`$DRONE_SOURCE_BRANCH\`]($DRONE_COMMIT_LINK). click the link below to see the details."
- export MSG_TITLE="❌🎁🏍️ fail to build and benchmark the docker image!"
- export MSG_CONTENT="please inform [$DRONE_COMMIT_AUTHOR]($DRONE_COMMIT_AUTHOR_EMAIL) to modify and fix [\`$DRONE_SOURCE_BRANCH\`]($DRONE_COMMIT_LINK). click the link below to see the details."
- ./shell/push-wechatwork.sh
when:
status:
- failure

trigger:
branch:
- master
event:
- tag
- push

volumes:
- name: docker
host:
path: /var/run/docker.sock
- name: cache
host:
path: /tmp/

---

kind: pipeline
name: master-docker-benchmark
name: release-docker-build

clone:
depth: 10
depth: 50

steps:
- name: notify the start on wechat work
@@ -174,9 +152,9 @@ steps:
BOT_URL:
from_secret: BOT_URL
commands:
- export MSG_LINK=${DRONE_BUILD_LINK}
- export MSG_TITLE="🏎️🐎 Start to benchmark the new master \`$DRONE_SOURCE_BRANCH\`(\`${DRONE_BUILD_NUMBER}\`)"
- export MSG_CONTENT="click the link below to see the status"
- export MSG_LINK=$DRONE_BUILD_LINK
- export MSG_TITLE="⌛🗳 Start to build docker image for new release \`$DRONE_SOURCE_BRANCH\`(\`${DRONE_TAG}\`)"
- export MSG_CONTENT="[tag link](https://github.com/gnes-ai/gnes/tree/${DRONE_TAG}), click the link below to see the status"
- ./shell/push-wechatwork.sh

- name: build and push docker images
@@ -185,8 +163,6 @@ steps:
volumes:
- name: docker
path: /var/run/docker.sock
- name: cache
path: /workspace
environment:
TCLOUD_USER:
from_secret: TCLOUD_USER
@@ -204,63 +180,21 @@ steps:
from_secret: GITHUB_USER
GITHUB_PWD:
from_secret: GITHUB_PWD
DO_BENCHMARK:
from_secret: DO_BENCHMARK
BENCHMARK_DIR: /workspace/benchmark/
SHARED_HOST_PATH: /tmp/
commands:
- ./benchmark-eval.sh
- docker system prune -a -f
- ./docker-build.sh

- name: notify the sucess on wechat work
image: byrnedo/alpine-curl
environment:
BOT_URL:
from_secret: BOT_URL
commands:
- export MSG_LINK="https://github.com/gnes-ai/benchmark"
- export MSG_TITLE="✅🏍️ New benchmark is updated!"
- export MSG_LINK="https://github.com/gnes-ai/gnes/tree/${DRONE_TAG}"
- export MSG_TITLE="✅🎁 All images are successfully delivered!"
- export MSG_CONTENT=""
- ./shell/push-wechatwork.sh

- name: notify the failure on wechat work
image: byrnedo/alpine-curl
environment:
BOT_URL:
from_secret: BOT_URL
commands:
- export MSG_LINK="https://github.com/gnes-ai/benchmark"
- export MSG_TITLE="❌🏍 fail to benchmark GNES!"
- export MSG_CONTENT="please inform [$DRONE_COMMIT_AUTHOR]($DRONE_COMMIT_AUTHOR_EMAIL) to modify and fix [\`$DRONE_SOURCE_BRANCH\`]($DRONE_COMMIT_LINK). click the link below to see the details."
- ./shell/push-wechatwork.sh
when:
status:
- failure

trigger:
branch:
- master
event:
- push

volumes:
- name: docker
host:
path: /var/run/docker.sock
- name: cache
host:
path: /tmp/

---

kind: pipeline
name: release-docker-benchmark

clone:
depth: 10

steps:
- name: notify the start on wechat work
- name: notify the start on benchmark work
image: byrnedo/alpine-curl
environment:
BOT_URL:
@@ -321,9 +255,9 @@ steps:
BOT_URL:
from_secret: BOT_URL
commands:
- export MSG_LINK="https://github.com/gnes-ai/benchmark"
- export MSG_TITLE="❌🏍 fail to benchmark GNES!"
- export MSG_CONTENT="please inform [$DRONE_COMMIT_AUTHOR]($DRONE_COMMIT_AUTHOR_EMAIL) to modify and fix [\`$DRONE_SOURCE_BRANCH\`]($DRONE_COMMIT_LINK). click the link below to see the details."
- export MSG_LINK=$DRONE_BUILD_LINK
- export MSG_TITLE="❌🎁🏍️ fail to build and benchmark the docker image!"
- export MSG_CONTENT="[tag link](https://github.com/gnes-ai/gnes/tree/${DRONE_TAG}) please inform [$DRONE_COMMIT_AUTHOR]($DRONE_COMMIT_AUTHOR_EMAIL) to modify and fix [\`$DRONE_SOURCE_BRANCH\`]($DRONE_COMMIT_LINK). click the link below to see the details."
- ./shell/push-wechatwork.sh
when:
status:

0 comments on commit ccf4efc

Please sign in to comment.
You can’t perform that action at this time.