优化
This commit is contained in:
+1
-1
@@ -41,7 +41,7 @@ pipeline {
|
|||||||
|
|
||||||
environment {
|
environment {
|
||||||
REGISTRY_CREDENTIALS = 'gitea-test-token'
|
REGISTRY_CREDENTIALS = 'gitea-test-token'
|
||||||
MAVEN_SETTINGS = 'deploy/maven/settings-cn.xml'
|
MAVEN_SETTINGS = 'deploy/maven/settings-ci.xml'
|
||||||
MAVEN_OPTS = '-Dfile.encoding=UTF-8 -Dmaven.wagon.http.retryHandler.count=3'
|
MAVEN_OPTS = '-Dfile.encoding=UTF-8 -Dmaven.wagon.http.retryHandler.count=3'
|
||||||
DEVELOPMENT_SSH_TARGET = 'deploy@172.31.198.8'
|
DEVELOPMENT_SSH_TARGET = 'deploy@172.31.198.8'
|
||||||
DEVELOPMENT_SSH_KEY = '/var/jenkins_home/.ssh/dev_deploy'
|
DEVELOPMENT_SSH_KEY = '/var/jenkins_home/.ssh/dev_deploy'
|
||||||
|
|||||||
@@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd">
|
||||||
|
<mirrors>
|
||||||
|
<mirror>
|
||||||
|
<id>aliyun-public</id>
|
||||||
|
<name>阿里云 Maven 公共仓库</name>
|
||||||
|
<url>https://maven.aliyun.com/repository/public</url>
|
||||||
|
<mirrorOf>central</mirrorOf>
|
||||||
|
</mirror>
|
||||||
|
</mirrors>
|
||||||
|
|
||||||
|
<profiles>
|
||||||
|
<profile>
|
||||||
|
<id>国内-CI-仓库</id>
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>central</id>
|
||||||
|
<url>https://repo.maven.apache.org/maven2</url>
|
||||||
|
<releases><enabled>true</enabled></releases>
|
||||||
|
<snapshots><enabled>false</enabled></snapshots>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
<pluginRepositories>
|
||||||
|
<pluginRepository>
|
||||||
|
<id>central</id>
|
||||||
|
<url>https://repo.maven.apache.org/maven2</url>
|
||||||
|
<releases><enabled>true</enabled></releases>
|
||||||
|
<snapshots><enabled>false</enabled></snapshots>
|
||||||
|
</pluginRepository>
|
||||||
|
</pluginRepositories>
|
||||||
|
</profile>
|
||||||
|
</profiles>
|
||||||
|
|
||||||
|
<activeProfiles>
|
||||||
|
<activeProfile>国内-CI-仓库</activeProfile>
|
||||||
|
</activeProfiles>
|
||||||
|
</settings>
|
||||||
@@ -6,6 +6,8 @@ const pipeline = (await readFile(new URL('../Jenkinsfile.service', import.meta.u
|
|||||||
.replaceAll('\r\n', '\n')
|
.replaceAll('\r\n', '\n')
|
||||||
const deployScript = (await readFile(new URL('../deploy/scripts/deploy-services.sh', import.meta.url), 'utf8'))
|
const deployScript = (await readFile(new URL('../deploy/scripts/deploy-services.sh', import.meta.url), 'utf8'))
|
||||||
.replaceAll('\r\n', '\n')
|
.replaceAll('\r\n', '\n')
|
||||||
|
const ciMavenSettings = (await readFile(new URL('../deploy/maven/settings-ci.xml', import.meta.url), 'utf8'))
|
||||||
|
.replaceAll('\r\n', '\n')
|
||||||
|
|
||||||
test('test deployments compile packages without rerunning the full unit test suite', () => {
|
test('test deployments compile packages without rerunning the full unit test suite', () => {
|
||||||
assert.match(pipeline, /params\.ENVIRONMENT == 'test' \|\| params\.SKIP_TESTS/)
|
assert.match(pipeline, /params\.ENVIRONMENT == 'test' \|\| params\.SKIP_TESTS/)
|
||||||
@@ -25,3 +27,9 @@ test('Java builds use the shared builder pool and deploy on the target environme
|
|||||||
assert.match(pipeline, /docker push \$\{image\}/)
|
assert.match(pipeline, /docker push \$\{image\}/)
|
||||||
assert.match(deployScript, /pull \$SERVICES/)
|
assert.match(deployScript, /pull \$SERVICES/)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
test('shared builders use a reachable public Maven mirror instead of the retired private proxy', () => {
|
||||||
|
assert.match(pipeline, /MAVEN_SETTINGS = 'deploy\/maven\/settings-ci\.xml'/)
|
||||||
|
assert.match(ciMavenSettings, /https:\/\/maven\.aliyun\.com\/repository\/public/)
|
||||||
|
assert.doesNotMatch(ciMavenSettings, /:18081/)
|
||||||
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user