【发布时间】:2020-02-09 12:17:20
【问题描述】:
我尝试使用 gitlab-ci 构建管道以生成一组微服务 jar,并从独立服务开始作为试用版,但 .gitmodules 文件无法正常工作,我将其配置为 gitlab-doc 解释
这是我的.gitmodules 文件
[submodule "logging-service"]
path = logging-service
branch = develop
url = ../logging-service
这是我的.gitlab-ci.yml 文件
stages:
- maven_build
- test_coverage
- sonar_qube
- deploy_cf_critical_services_dev
- deploy_cf_rest_of_services_dev
- postman_tests
variables:
GIT_SUBMODULE_STRATEGY: recursive
SONAR_URL: http://localhost:9000
SONAR_USERNAME: admin
SONAR_PASSWORD: admin
sonar_qube_phase_logging-service:
image: sonarqube:latest
stage: sonar_qube
script:
- mvn -f sonar:sonar logging-service/pom.xml -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_USERNAME -Dsonar.password=$SONAR_PASSWORD
test_coverage_phase_logging-service:
image: dockerproxy-iva.si.francetelecom.fr/maven:3.3.9-jdk-8
stage: test_coverage
script:
- mvn clean verify -f ../logging-service/pom.xml
maven_build_phase_logging-service:
image: dockerproxy-iva.si.francetelecom.fr/maven:3.3.9-jdk-8
stage: maven_build
script:
- mvn install -f logging-service/pom.xml -Dmaven.test.skip=true
artifacts:
name: logging-service #jar name
paths:
- logging-service/target
expire_in: 1 day
并且从 maven 生成的错误在路径中找不到 pom.xml 错误路径
/builds/ole_bothub/bothub-deployment-dev/logging-service/pom.xml
并且路径应该如下所示
/builds/ole_bothub/logging-service/pom.xml
这里是 maven_build_phase_logging-service 作业的日志
Updating/initializing submodules recursively...
$ mvn install -f logging-service/pom.xml -Dmaven.test.skip=true
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-readable POM /builds/ole_bothub/bothub-deployment-dev/logging-service/pom.xml: /builds/ole_bothub/bothub-deployment-dev/logging-service/pom.xml (No such file or directory) @
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project (/builds/ole_bothub/bothub-deployment-dev/logging-service/pom.xml) has 1 error
[ERROR] Non-readable POM /builds/ole_bothub/bothub-deployment-dev/logging-service/pom.xml: /builds/ole_bothub/bothub-deployment-dev/logging-service/pom.xml (No such file or directory)
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
【问题讨论】: