demo/.woodpecker.yaml

29 lines
900 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# .woodpecker.yaml
steps:
- name: Java 构建
image: maven:3.9.6-eclipse-temurin-17
pull: true
commands:
- mvn clean package -DskipTests
# 注意:使用 volumes 必须在 Web UI 中开启 "Trusted" 权限
volumes:
- /tmp/maven-cache:/root/.m2
when:
event: [push, pull_request]
branch: main
- name: 镜像构建与推送
image: plugins/docker
settings:
repo: registry.cn-zhangjiakou.aliyuncs.com/abhors/demo
tags: latest
registry: registry.cn-zhangjiakou.aliyuncs.com
username:
from_secret: aliyun_acr_username
password:
from_secret: aliyun_acr_password
# 很多时候 plugins/docker 内部默认会处理 context不需要你手动挂载 docker.sock
# 但需要确保服务器配置了 WOODPECKER_PLUGINS_PRIVILEGED=plugins/docker
when:
event: push
branch: main