Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix(cd): fix trigger in cd pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhxiao committed Sep 27, 2019
1 parent fdc38d5 commit ccf4efc
Showing 1 changed file with 34 additions and 100 deletions.
134 changes: 34 additions & 100 deletions .drone-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -105,6 +71,8 @@ steps:
volumes:
- name: docker
path: /var/run/docker.sock
- name: cache
path: /workspace
environment:
TCLOUD_USER:
from_secret: TCLOUD_USER
Expand All @@ -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

Expand All @@ -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
Expand All @@ -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
Expand All @@ -185,8 +163,6 @@ steps:
volumes:
- name: docker
path: /var/run/docker.sock
- name: cache
path: /workspace
environment:
TCLOUD_USER:
from_secret: TCLOUD_USER
Expand All @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit ccf4efc

Please sign in to comment.