forked from capricorn416/HR-system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.drone.yml
102 lines (101 loc) · 2.62 KB
/
.drone.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
kind: pipeline
type: docker
name: default
trigger:
event:
- pull_request
- push
- custom
steps:
- name: start comment
image: jmccann/drone-github-comment:1
settings:
message: '<h2><a target="_blank" href="${DRONE_SYSTEM_PROTO}://${DRONE_SYSTEM_HOST}/${DRONE_REPO}/${DRONE_BUILD_NUMBER}/">CI Is Running⌛⌛⌛</a></h2> <b>click the link above for details </b>'
update: true
when:
ref:
include:
- refs/pull/**
- name: build
image: node:14.21.3
commands:
- yarn config set registry https://registry.npmmirror.com
- yarn install
- yarn run build
when:
ref:
include:
- refs/pull/**
- refs/heads/main
- name: docker
image: plugins/docker
depends_on:
- "build"
settings:
username:
from_secret: harbor_username
password:
from_secret: harbor_password
repo: harbor.pivotstudio.cn/hr-system/hr-front
registry: harbor.pivotstudio.cn
tags:
- latest
- build-${DRONE_BUILD_NUMBER}
when:
branch:
- master
event:
- push
- name: comment
image: jmccann/drone-github-comment:1
settings:
message: '<h2><a href="${DRONE_SYSTEM_PROTO}://${DRONE_SYSTEM_HOST}/${DRONE_REPO}/${DRONE_BUILD_NUMBER}">CI Success✔️✔️✔️</a></h2><b>click the link above for details</b>'
update: true
depends_on:
- "build"
when:
ref:
include:
- refs/pull/**
- name: failed comment
image: jmccann/drone-github-comment:1
settings:
message: '<h2><a href="${DRONE_SYSTEM_PROTO}://${DRONE_SYSTEM_HOST}/${DRONE_REPO}/${DRONE_BUILD_NUMBER}">CI Failed❌❌❌</a></h2><b>click the link above for details</b>'
update: true
when:
ref:
include:
- refs/pull/**
status:
- failure
- name: k8s cd
image: harbor.pivotstudio.cn/common/dron8s:latest
pull: if-not-exists
depends_on:
- "docker"
settings:
yaml: deploy/hr-front.yaml
build_tag: build-${DRONE_BUILD_NUMBER}
kubeconfig:
from_secret: kube_config
when:
branch:
- master
event:
- push
- name: failed notification
image: registry.cn-beijing.aliyuncs.com/husterdjx/droneplugin-bot:latest
settings:
title: CI 运行失败
author: "${DRONE_COMMIT_AUTHOR}"
branch: "${DRONE_COMMIT_BRANCH}"
repourl: "${DRONE_REPO_LINK}"
message: "${DRONE_COMMIT_MESSAGE}"
githash: "${DRONE_COMMIT}"
depends_on:
- k8s cd
- docker
- build
when:
status:
- failure