drone_plugin/.drone.yml

52 lines
990 B
YAML
Raw Normal View History

2021-12-29 21:05:22 +08:00
2021-12-28 15:20:31 +08:00
kind: pipeline
type: docker
name: 部署drone_plugin
clone:
disable: true
steps:
- name: clone
image: alpine/git
commands:
- git clone ${DRONE_REMOTE_URL} .
- git checkout $DRONE_COMMIT
when:
branch:
- master
- name: build
image: plugins/docker
volumes:
- name: docker
path: /var/run/docker.sock
settings:
username:
from_secret: reg_username
password:
from_secret: reg_password
repo: reg.icechen.cn/pkg/drone_plugin
registry: reg.icechen.cn
tags: ${DRONE_COMMIT:0:8}
when:
branch:
- master
- name: run
image: docker/compose
volumes:
- name: docker
path: /var/run/docker.sock
commands:
- export TAG=${DRONE_COMMIT:0:8}
- docker-compose -p drone_plugin down
- docker-compose -p drone_plugin up -d
when:
branch:
- master
volumes:
- name: docker
host:
path: /var/run/docker.sock