chore: add drone yml
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
fb46ba4395
commit
a7f3479fcf
|
@ -0,0 +1,58 @@
|
|||
# drone 会按顺序执行 pipeline 配置中定义的任务
|
||||
|
||||
# main 分支在 build 和 PR 时执行的 pipeline
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: main-pipeline
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
trigger:
|
||||
branch:
|
||||
include:
|
||||
- main
|
||||
event:
|
||||
include:
|
||||
- custom
|
||||
- push
|
||||
|
||||
clone:
|
||||
disable: true
|
||||
|
||||
steps:
|
||||
- name: deploy-k8s-master
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host:
|
||||
from_secret: k8s_master
|
||||
username: ubuntu
|
||||
key:
|
||||
from_secret: k8s_key
|
||||
port: 22
|
||||
script_stop: true
|
||||
script:
|
||||
- cd /var/www/pzx-web-api
|
||||
- sudo git fetch
|
||||
- sudo git reset --hard ${DRONE_COMMIT}
|
||||
- sudo docker-compose down
|
||||
- sudo docker-compose up -d --build --force-recreate
|
||||
- sudo docker image prune -f
|
||||
- name: deploy-k8s-worker
|
||||
image: appleboy/drone-ssh
|
||||
settings:
|
||||
host:
|
||||
from_secret: k8s_worker
|
||||
username: ubuntu
|
||||
key:
|
||||
from_secret: k8s_key
|
||||
port: 22
|
||||
script_stop: true
|
||||
script:
|
||||
- cd /var/www/pzx-web-api
|
||||
- sudo git fetch
|
||||
- sudo git reset --hard ${DRONE_COMMIT}
|
||||
- sudo docker-compose down
|
||||
- sudo docker-compose up -d --build --force-recreate
|
||||
- sudo docker image prune -f
|
Loading…
Reference in New Issue