You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
kind: pipeline
|
|
|
|
|
type: docker
|
|
|
|
|
name: master
|
|
|
|
|
steps:
|
|
|
|
|
- name: restore-cache
|
|
|
|
|
image: meltwater/drone-cache
|
|
|
|
|
settings:
|
|
|
|
|
backend: filesystem
|
|
|
|
|
restore: true
|
|
|
|
|
cache_key: "maven"
|
|
|
|
|
archive_format: gzip
|
|
|
|
|
filesystem_cache_root: "/var/lib/cache"
|
|
|
|
|
mount:
|
|
|
|
|
- "maven"
|
|
|
|
|
volumes:
|
|
|
|
|
- name: cache
|
|
|
|
|
path: "/var/lib/cache"
|
|
|
|
|
# Do stuff..
|
|
|
|
|
- name: build
|
|
|
|
|
image: maven:3.8-openjdk-8
|
|
|
|
|
commands:
|
|
|
|
|
- mkdir /root/.m2
|
|
|
|
|
- cp /usr/share/maven/ref/settings-docker.xml /root/.m2/settings.xml
|
|
|
|
|
- sed -i 's/\\/usr\\/share\\/maven\\/ref\\/repository/\\/drone\\/src\\/maven/g' /root/.m2/settings.xml
|
|
|
|
|
- mvn package
|
|
|
|
|
|
|
|
|
|
- name: rebuild-cache
|
|
|
|
|
image: meltwater/drone-cache
|
|
|
|
|
settings:
|
|
|
|
|
backend: filesystem
|
|
|
|
|
rebuild: true
|
|
|
|
|
cache_key: "maven"
|
|
|
|
|
archive_format: gzip
|
|
|
|
|
filesystem_cache_root: "/var/lib/cache"
|
|
|
|
|
mount:
|
|
|
|
|
- "maven"
|
|
|
|
|
volumes:
|
|
|
|
|
- name: cache
|
|
|
|
|
path: "/var/lib/cache"
|
|
|
|
|
|
|
|
|
|
- name: build-docker-image
|
|
|
|
|
image: plugins/docker
|
|
|
|
|
volumes:
|
|
|
|
|
- name: dockersock
|
|
|
|
|
path: /var/run/docker.sock
|
|
|
|
|
settings:
|
|
|
|
|
dockerfile: Dockerfile
|
|
|
|
|
repo: 192.168.230.38:8888/zabbix/back
|
|
|
|
|
registry: 192.168.230.38:8888
|
|
|
|
|
insecure: true # 如果需要使用不安全的连接,可以设置为 true
|
|
|
|
|
username:
|
|
|
|
|
from_secret: harbor_user
|
|
|
|
|
password:
|
|
|
|
|
from_secret: harbor_psw
|
|
|
|
|
tags: latest
|
|
|
|
|
|
|
|
|
|
# - name: notify
|
|
|
|
|
# pull: if-not-exists # 如果镜像不存在则拉取,免去每次都要重新下载
|
|
|
|
|
# image: drillster/drone-email
|
|
|
|
|
# settings:
|
|
|
|
|
# recipients_only: true # 只发送给指定邮件收件人,不默认发送给流水线创建人
|
|
|
|
|
# host: smtp.qq.com #SMTP服务器 例如 smtp.qq.com
|
|
|
|
|
# port: 465 #SMTP服务端口 例如QQ邮箱端口465
|
|
|
|
|
# subject: "Drone Build Complete!" # 邮件主题内容
|
|
|
|
|
# username: #邮箱用户名
|
|
|
|
|
# from_secret: qqmail_username
|
|
|
|
|
# password: #邮箱密码
|
|
|
|
|
# from_secret: qqmail_pwd
|
|
|
|
|
# from:
|
|
|
|
|
# from_secret: qqmail_username
|
|
|
|
|
# recipients: #收件人
|
|
|
|
|
# from_secret: email_recipients # 格式:xxxx,xxxx
|
|
|
|
|
# when: #执行条件
|
|
|
|
|
# status:
|
|
|
|
|
# - success
|
|
|
|
|
# - changed
|
|
|
|
|
# - failure
|
|
|
|
|
|
|
|
|
|
volumes: # 定义流水线挂载目录,用于共享数据
|
|
|
|
|
- name: cache
|
|
|
|
|
host:
|
|
|
|
|
path: "/var/lib/cache"
|
|
|
|
|
- name: dockersock
|
|
|
|
|
host:
|
|
|
|
|
path: /var/run/docker.sock
|
|
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
|
branch:
|
|
|
|
|
- master
|
|
|
|
|
event:
|
|
|
|
|
- push
|
|
|
|
|
- merge
|