drone-test/.drone.yml

55 lines
1.2 KiB
YAML
Raw Normal View History

2022-06-15 10:31:40 +08:00
kind: pipeline
type: docker
name: BuildDev
trigger:
event: [push]
branch: [ master ]
steps:
- name: BuildToRegistry
image: plugins/docker
settings:
2022-06-15 10:57:59 +08:00
registry: registry.cn-shanghai.aliyuncs.com
2022-06-15 14:21:27 +08:00
repo: registry.cn-shanghai.aliyuncs.com/docker-echo/drone-test
2022-06-15 10:31:40 +08:00
username:
2022-06-15 15:05:38 +08:00
from_secret: registry_username
2022-06-15 10:31:40 +08:00
password:
2022-06-15 15:05:38 +08:00
from_secret: registry_password
2022-06-15 10:31:40 +08:00
use_cache: true
# event为push且分支为master的时候自动打latest为tag则会根据tag自动生成
tag:
- latest
- sha_${DRONE_COMMIT_SHA}
2022-06-15 15:05:38 +08:00
when:
status:
- "success"
2022-06-16 18:17:58 +08:00
- echo hello
- echo world
2022-06-15 15:05:38 +08:00
---
kind: pipeline
type: docker
name: BuildProd
trigger:
event: [tag]
steps:
- name: BuildToRegistry
image: plugins/docker
# depends_on:
# - CheckCode
settings:
registry: registry.cn-shanghai.aliyuncs.com
repo: registry.cn-shanghai.aliyuncs.com/docker-echo/drone-test
username:
from_secret: registry_username
password:
from_secret: registry_password
use_cache: true
# event为push且分支为master的时候自动打latest为tag则会根据tag自动生成
auto_tag: true
2022-06-15 10:31:40 +08:00
when:
status:
- "success"