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

Commit

Permalink
feat(cd): trigger benchmark in push and tag
Browse files Browse the repository at this point in the history
  • Loading branch information
hanhxiao committed Sep 27, 2019
1 parent f8b9e00 commit fdc38d5
Showing 1 changed file with 91 additions and 1 deletion.
92 changes: 91 additions & 1 deletion .drone-cd.yml
Expand Up @@ -241,7 +241,97 @@ trigger:
branch: branch:
- master - master
event: event:
- pull_request - 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
image: byrnedo/alpine-curl
environment:
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_TAG}\`)"
- export MSG_CONTENT="click the link below to see the status"
- ./shell/push-wechatwork.sh

- name: build and push docker images
image: gnes/dind
privileged: true
volumes:
- name: docker
path: /var/run/docker.sock
- name: cache
path: /workspace
environment:
TCLOUD_USER:
from_secret: TCLOUD_USER
TCLOUD_PWD:
from_secret: TCLOUD_PWD
HUB_USER:
from_secret: HUB_USER
HUB_PWD:
from_secret: HUB_PWD
BADGE_WEBHOOK:
from_secret: BADGE_WEBHOOK
BOT_URL:
from_secret: BOT_URL
GITHUB_USER:
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

- 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_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:
event:
- tag


volumes: volumes:
- name: docker - name: docker
Expand Down

0 comments on commit fdc38d5

Please sign in to comment.