drone/.drone.yml
liupeng 6a0af0b46f
Some checks failed
continuous-integration/drone/push Build is failing
update
2024-02-28 12:36:34 +08:00

96 lines
1.8 KiB
YAML

kind: pipeline
name: default
clone:
depth: 10
steps:
# 开发版
- name: docker-${DRONE_BRANCH}
image: plugins/docker:18.09
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:18.09
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
port: 22
command_timeout: 2m
script:
- echo "deploy ssh!"
- name=test-demo
- image=git.daymele.com/liupeng/drone:canary
- echo ${DRONE_BRANCH}
- docker pull $image
- docker rm -f test-demo || true
- docker image prune -f
- docker run --name=$name -d -p 8001:9000 $image
when:
branch:
- master
- dev
event:
- push
- name: deploy-release
image: appleboy/drone-ssh
settings:
host:
- dev.daymele.com
username: liuo
password:
from_secret: HOST_PASSWORD
port: 22
command_timeout: 2m
script:
- echo "deploy ssh!"
- name=demo-test
- image=git.daymele.com/liupeng/drone::latest
- docker pull $image
- docker rm -f test-demo || true
- docker image prune -f
- docker run --name=$name -d -p 8001:9000 $image
when:
event:
- tag