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.

93 lines
2.5 KiB

2 years ago
kind: pipeline
type: docker
2 years ago
name: master
2 years ago
steps:
2 years ago
- 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"
2 years ago
# Do stuff..
2 years ago
- name: build
image: maven:3.8-openjdk-8
commands:
2 years ago
- 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
2 years ago
2 years ago
- 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"
2 years ago
2 years ago
- name: build-docker-image
image: plugins/docker
2 years ago
volumes:
- name: dockersock
path: /var/run/docker.sock
2 years ago
settings:
dockerfile: Dockerfile
2 years ago
repo: 192.168.230.38:8888/zabbix/back
2 years ago
registry: 192.168.230.38:8888
2 years ago
insecure: true # 如果需要使用不安全的连接,可以设置为 true
2 years ago
username:
from_secret: harbor_user
password:
from_secret: harbor_psw
2 years ago
tags: latest
2 years ago
# - 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
2 years ago
2 years ago
volumes: # 定义流水线挂载目录,用于共享数据
- name: cache
host:
path: "/var/lib/cache"
2 years ago
- name: dockersock
host:
path: /var/run/docker.sock
2 years ago
trigger:
branch:
2 years ago
- master
2 years ago
event:
- push
- merge