当我尝试运行 GitLab 管道时,它失败并显示
eval:第 159 行:在 gitlab 管道上查找匹配错误时出现意外的 EOF 此错误
stages: # List of stages for jobs, and their order of execution
- build
- test
- deploy-uat
variables:
NUGET_PATH: 'C:\GitLab-Runner\nuget.exe'
MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe'
TEST_TOOL_EXE: 'C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\Common7\IDE\Extensions\TestPlatform\vstest.console.exe'
build-job: # This job runs in the build stage, which runs first.
stage: build
script:
- echo "$CI_PROJECT_DIR"
- 'env:NUGET_PATH" restore'
- echo "Clean & Build Solution"
- '& "$env:MSBUILD_PATH" .\Solution1.sln /p:Configuration=Release /p:DeployOnBuild=True /p:DeployDefaultTarget=WebPublish /p:WebPublishMethod=FileSystem /p:DeleteExistingFiles=True /p:publishUrl=.\bin\publish /clp:ErrorsOnly'
artifacts:
expire_in: 2 days
paths:
- "**/bin"
- "**/obj"
rules:
- if: ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "main")
你能帮我解决这个错误吗?
我不清楚您的运行程序在这里使用的是什么 shell,但我怀疑(直接)问题是因为您的作业脚本步骤中的引号不平衡。例如:
- 'env:NUGET_PATH" restore'
"
是无与伦比的。