在 gitlab 上构建项目时出错"-outputfile"



在我的项目中,我使用GitVersion。MsBuild库用于跟踪wpf上的应用程序版本.

在gitlab中构建时,有一个

error MSB3073: 
exit command ..net48/gitversion.exe C:gitlab-runnerbuilds...imgupdWpf 
-output file -outputfile C:gitlab-runnerbuildsDN7xGEXb...Wpf/gitversion.json" 
with code 1. 
[C:gitlab-runnerbuildsDN7xGEXb..Wpf.csproj]

还有其他人遇到过这个问题吗?
网络说这个问题已经解决了新版本的GitVersion.MsBuild库的发布,但我仍然得到这个错误。

我的gitlab-ci文件是这样的

variables:
EXE_RELEASE_FOLDER: 'WpfbinReleasenetcoreapp3.1'
NUGET_PATH: 'C:NuGetnuget.exe'
MSBUILD_PATH: 'C:Program Files (x86)Microsoft Visual Studio2019CommunityMSBuildCurrentBinmsbuild.exe'
ARTIFACTS_NAME: "imgupd"
stages:
- build
#- test
- deploy
build_job:
stage: build
before_script:
- CHCP 65001
rules:
- if: $CI_COMMIT_BRANCH
when: on_success
allow_failure: false
- if: $CI_COMMIT_TAG
when: on_success
allow_failure: false
script:
- '& "$env:NUGET_PATH" restore' # restore Nuget dependencies
- '& "$env:MSBUILD_PATH" /p:Configuration=Release /clp:ErrorsOnly' # build the project
- '$deployFolder = $($env:ARTIFACTS_NAME) + ""'
- 'xcopy /y /e ".$env:EXE_RELEASE_FOLDER*" "$deployFolder"'
artifacts:
name: "$env:ARTIFACTS_NAME"
expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on
paths:
- '$env:ARTIFACTS_NAME' # saving exe to copy to deploy folder
#- '$env:MSI_RELEASE_FOLDERConfigurator Setup.msi' # saving msi to copy to deploy folder
deploy_job:
stage: deploy
before_script:
- CHCP 65001
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
when: never
- if: $CI_COMMIT_BRANCH
when: on_success
allow_failure: false
- if: $CI_COMMIT_TAG
when: on_success
allow_failure: false
script:
- '$commitSubject = git log -1 --pretty=%s'
dependencies:
- build_job

这仍然是GitTools/GitVersion第2993期的报告。

它确实包括警告(GitHub动作):

对于GitVersion成功执行,它需要完整的存储库历史。

默认情况下,actions/checkout进行浅克隆。将以下内容添加到工作流中,它至少应该能够执行:

- uses: actions/checkout@v2
with:
fetch-depth: 0

如果您有一个浅克隆(IE:GIT_DEPTHset),请在您的gitlab-ci中仔细检查。

如果不是,检查这是否与问题2534有关:由于文件路径obj/gitversion.json格式错误导致的构建错误,因为您的错误消息还包括这样的/路径分隔符组合。

相关内容

  • 没有找到相关文章

最新更新