Merge pull request '[fix]:[修改drone中的源为国内源]' (#15) from yinzy_dev into main
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: jk_yinzy/adsfasdfsadf#15
This commit is contained in:
commit
26356c3124
25
.drone.yml
25
.drone.yml
@ -13,7 +13,29 @@ steps:
|
|||||||
- name: java-build
|
- name: java-build
|
||||||
image: maven:3.9-eclipse-temurin
|
image: maven:3.9-eclipse-temurin
|
||||||
pull: false
|
pull: false
|
||||||
|
environment:
|
||||||
|
MAVEN_OPTS: -Dmaven.repo.local=.m2/repository
|
||||||
commands:
|
commands:
|
||||||
|
# 先创建 .m2 目录
|
||||||
|
- mkdir -p ~/.m2
|
||||||
|
# 动态生成 settings.xml(仅用于 CI)
|
||||||
|
- |
|
||||||
|
cat > ~/.m2/settings.xml << 'EOF'
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
|
||||||
|
<mirrors>
|
||||||
|
<mirror>
|
||||||
|
<id>aliyun</id>
|
||||||
|
<mirrorOf>*</mirrorOf>
|
||||||
|
<name>Aliyun Maven</name>
|
||||||
|
<url>https://maven.aliyun.com/repository/public</url>
|
||||||
|
</mirror>
|
||||||
|
</mirrors>
|
||||||
|
</settings>
|
||||||
|
EOF
|
||||||
|
- mvn clean verify
|
||||||
- if [ -f pom.xml ]; then mvn clean compile; fi
|
- if [ -f pom.xml ]; then mvn clean compile; fi
|
||||||
when:
|
when:
|
||||||
event: [ push, pull_request ]
|
event: [ push, pull_request ]
|
||||||
@ -23,6 +45,9 @@ steps:
|
|||||||
image: python:3.12.0-slim
|
image: python:3.12.0-slim
|
||||||
pull: false
|
pull: false
|
||||||
commands:
|
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 requirements.txt ]; then pip install -r requirements.txt; fi
|
||||||
- if [ -f test_example.py ]; then python -m pytest test_example.py -v; fi
|
- if [ -f test_example.py ]; then python -m pytest test_example.py -v; fi
|
||||||
when:
|
when:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user