83 lines
1.4 KiB
YAML
83 lines
1.4 KiB
YAML
# kubectl create secret generic build-node-secret \
|
|
# --from-literal=HOST="" \
|
|
# --from-file=KEY=./*.pem \
|
|
# --from-literal=PORT="22" \
|
|
# --from-literal=PATH="" \
|
|
# --namespace=drone
|
|
|
|
kind: pipeline
|
|
type: kubernetes
|
|
name: MD BUILD
|
|
|
|
trigger:
|
|
event:
|
|
include:
|
|
- custom
|
|
|
|
workspace:
|
|
base: /drone/
|
|
path: /drone/Kubernetes
|
|
|
|
steps:
|
|
- name: 编译文档正文
|
|
image: registry.cn-hangzhou.aliyuncs.com/offends/drone:ubuntu-22.04
|
|
pull: if-not-exists
|
|
commands:
|
|
- ./builder.sh
|
|
- rm -rf ./builder.sh
|
|
- name: 生产环境部署
|
|
image: appleboy/drone-scp
|
|
pull: if-not-exists
|
|
settings:
|
|
host:
|
|
from_secret: HOST
|
|
key:
|
|
from_secret: KEY
|
|
port:
|
|
from_secret: PORT
|
|
target:
|
|
from_secret: PATH
|
|
user: root
|
|
source: ../Kubernetes
|
|
overwrite: true
|
|
- name: 重启生产博客组件
|
|
image: registry.cn-hangzhou.aliyuncs.com/offends/drone:ubuntu-22.04
|
|
volumes:
|
|
- name: kubectl
|
|
path: /usr/local/bin
|
|
- name: config
|
|
path: /root/.kube
|
|
commands:
|
|
- /usr/local/bin/kubectl -n blog rollout restart deployment blog
|
|
volumes:
|
|
- name: kubectl
|
|
host:
|
|
path: /usr/local/bin
|
|
type: File
|
|
- name: config
|
|
host:
|
|
path: /root/.kube
|
|
---
|
|
kind: secret
|
|
name: HOST
|
|
get:
|
|
path: build-node-secret
|
|
name: HOST
|
|
---
|
|
kind: secret
|
|
name: KEY
|
|
get:
|
|
path: build-node-secret
|
|
name: KEY
|
|
---
|
|
kind: secret
|
|
name: PORT
|
|
get:
|
|
path: build-node-secret
|
|
name: PORT
|
|
---
|
|
kind: secret
|
|
name: PATH
|
|
get:
|
|
path: build-node-secret
|
|
name: PATH |