drone_plugin/.drone.yml

53 lines
1009 B
YAML

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}
purge: false
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