drone/.drone.yml
liupeng 432cf4e768
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
continuous-integration/drone/pr Build is passing
fix err
2024-02-28 17:15:48 +08:00

100 lines
2.0 KiB
YAML

kind: pipeline
name: default
clone:
disable: false # 启用代码拉取
steps:
# 开发版
- name: docker-${DRONE_BRANCH}
image: plugins/docker
settings:
username: liupeng
password:
from_secret: DOCKER_PASSWORD
registry: git.daymele.com
repo: git.daymele.com/liupeng/drone
insecure: true
debug: true
dockerfile: Dockerfile
tags:
- canary
when:
branch:
- master
- dev
event:
- push
# 稳定版
- name: docker-release
image: plugins/docker
settings:
username: liupeng
password:
from_secret: DOCKER_PASSWORD
registry: git.daymele.com
repo: git.daymele.com/liupeng/drone
insecure: true
dockerfile: Dockerfile
tags:
- ${DRONE_TAG}
- latest
when:
event:
- tag
- name: deploy-${DRONE_BRANCH}
image: appleboy/drone-ssh
settings:
host:
- dev.daymele.com
username: liup
# password:
# from_secret: HOST_PASSWORD
key:
from_secret: HOST_KEY
port: 22
command_timeout: 2m
script:
- echo "deploy docker ssh!"
- name=drone-test
- image=git.daymele.com/liupeng/drone:canary
- echo ${DRONE_BRANCH}
- docker pull $image
- docker rm -f drone-test || true
- docker image prune -f
- docker run --name=$name -d -p 8001:9000 -v /etc/conf:/conf $image
when:
branch:
- master
- dev
event:
- push
- name: deploy-release
image: appleboy/drone-ssh
settings:
host:
- pub.daymele.com
username: liup
# password:
# from_secret: HOST_PASSWORD
key:
from_secret: HOST_KEY
port: 22
command_timeout: 2m
script:
- echo "deploy podman ssh!"
- name=drone-release
- image=git.daymele.com/liupeng/drone:latest
- podman pull $image
- podman rm -f drone-release || true
- podman image prune -f
- podman run --name=$name -d -p 8002:9000 -v /etc/conf:/conf $image
when:
event:
- tag