diff --git a/.drone.yml b/.drone.yml index dfc403b..3467ad0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -13,7 +13,27 @@ steps: - name: java-build image: maven:3.9-eclipse-temurin pull: false + environment: + MAVEN_OPTS: -Dmaven.repo.local=.m2/repository commands: + # 动态生成 settings.xml(仅用于 CI) + - | + cat > ~/.m2/settings.xml << 'EOF' + + + + + aliyun + * + Aliyun Maven + https://maven.aliyun.com/repository/public + + + + EOF + - mvn clean verify - if [ -f pom.xml ]; then mvn clean compile; fi when: event: [ push, pull_request ] @@ -23,6 +43,9 @@ steps: image: python:3.12.0-slim pull: false commands: + # 临时设置 pip 源(仅本次会话) + - pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple/ + - pip config set install.trusted-host pypi.tuna.tsinghua.edu.cn - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - if [ -f test_example.py ]; then python -m pytest test_example.py -v; fi when: