gitlab-ci: файл проекта не найден - PullRequest
0 голосов
/ 12 декабря 2018

Я новичок в непрерывной интеграции.Я пытаюсь заставить MsBuild работать на репозитории gitlab, который зависит от проектов вне репо.В примере были изменены конкретные имена в целях конфиденциальности (основной репо теперь называется myProject, проекты которого зависят от репо с именем Common):

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
Build started 12/12/2018 08:51:01.
Project "F:\gitlab-runner\builds\e941738d\0\myRepo\myProject\myProjectCS\myProjectCS.sln" on node 1 (Restore target(s)).
ValidateSolutionConfiguration:
  Building solution configuration "Debug|Mixed Platforms".
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets(241,5): error MSB3202: The project file "F:\gitlab-runner\builds\e941738d\0\myRepo\Common\Database Library\trunk\Database Library\Database Library.csproj" was not found. [F:\gitlab-runner\builds\e941738d\0\myRepo\myProject\myProjectCS\myProjectCS.sln]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets(241,5): error MSB3202: The project file "F:\gitlab-runner\builds\e941738d\0\myRepo\Common\Task Scheduler\trunk\Task Scheduler\Task Scheduler\Task Scheduler.csproj" was not found. [F:\gitlab-runner\builds\e941738d\0\myRepo\myProject\myProjectCS\myProjectCS.sln]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets(241,5): error MSB3202: The project file "F:\gitlab-runner\builds\e941738d\0\myRepo\Common\General Library\trunk\General Library.csproj" was not found. [F:\gitlab-runner\builds\e941738d\0\myRepo\myProject\myProjectCS\myProjectCS.sln]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets(241,5): error MSB3202: The project file "F:\gitlab-runner\builds\e941738d\0\myRepo\Common\Collections Library\trunk\Collections Library\Collections Library.csproj" was not found. [F:\gitlab-runner\builds\e941738d\0\myRepo\myProject\myProjectCS\myProjectCS.sln]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets(241,5): error MSB3202: The project file "F:\gitlab-runner\builds\e941738d\0\myRepo\Common\DynamicQuery\trunk\DynamicQuery.csproj" was not found. [F:\gitlab-runner\builds\e941738d\0\myRepo\myProject\myProjectCS\myProjectCS.sln]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets(241,5): error MSB3202: The project file "F:\gitlab-runner\builds\e941738d\0\myRepo\Common\zFTP\trunk\zFTP\zFTP.csproj" was not found. [F:\gitlab-runner\builds\e941738d\0\myRepo\myProject\myProjectCS\myProjectCS.sln]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets(241,5): error MSB3202: The project file "F:\gitlab-runner\builds\e941738d\0\myRepo\Common\GUI Tools\trunk\GUI Tools.csproj" was not found. [F:\gitlab-runner\builds\e941738d\0\myRepo\myProject\myProjectCS\myProjectCS.sln]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets(241,5): error MSB3202: The project file "F:\gitlab-runner\builds\e941738d\0\myRepo\Common\DataGridViewAutoFilter\trunk\DataGridViewAutoFilter.csproj" was not found. [F:\gitlab-runner\builds\e941738d\0\myRepo\myProject\myProjectCS\myProjectCS.sln]
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\NuGet\NuGet.targets(241,5): error MSB3202: The project file "F:\gitlab-runner\builds\e941738d\0\myRepo\Common\Web Library\trunk\Web Library.csproj" was not found. [F:\gitlab-runner\builds\e941738d\0\myRepo\myProject\myProjectCS\myProjectCS.sln]
Project "F:\gitlab-runner\builds\e941738d\0\myRepo\myProject\myProjectCS\myProjectCS.sln" (1) is building "F:\gitlab-runner\builds\e941738d\0\myRepo\myProject\myProjectCS\myProject Service Setup\myProject Service Setup.vdproj" (10) on node 1 (_IsProjectRestoreSupported target(s)).
F:\gitlab-runner\builds\e941738d\0\myRepo\myProject\myProjectCS\myProject Service Setup\myProject Service Setup.vdproj(1,1): error MSB4025: The project file could not be loaded. Data at the root level is invalid. Line 1, position 1.
Done Building Project "F:\gitlab-runner\builds\e941738d\0\myRepo\myProject\myProjectCS\myProject Service Setup\myProject Service Setup.vdproj" (_IsProjectRestoreSupported target(s)) -- FAILED.
Done Building Project "F:\gitlab-runner\builds\e941738d\0\myRepo\myProject\myProjectCS\myProjectCS.sln" (Restore target(s)) -- FAILED.

My gitlab-ci.yml:

variables:
    SONARSCANNER: "D:\\sonar-scanner-msbuild\\SonarScanner.MSBuild.exe"
    MSBUILD: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\MSBuild\\15.0\\Bin\\MSBuild.exe"
    MYPROJECT_SERVER: "myProject"
    CS_CONFIG: "<confidential>"
    SVC_CONFIG: "<confidential>"
    PROJECT_KEY: "myproject-server"
    PROJECT_VERSION: "1.0"
    GIT_SUBMODULE_STRATEGY: "recursive"

before_script:
- cd "%MYPROJECT_SERVER%"

stages:
    - test

sonarqube_master_job:
    stage: test
    script:
        - 'copy /Y "%CS_CONFIG%.default" "%CS_CONFIG%"'
        - 'copy /Y "%SVC_CONFIG%.default" "%SVC_CONFIG%"'
        - '"%MSBUILD%" /t:Restore'
        - '"%SONARSCANNER%" begin /k:"%PROJECT_KEY%" /v:"%PROJECT_VERSION%" /d:sonar.analysis.mode=publish /d:sonar.gitlab.commit_sha=%CI_COMMIT_SHA% /d:sonar.gitlab.project_id=%CI_PROJECT_ID% /d:sonar.gitlab.ref_name=%CI_COMMIT_REF_NAME%'
        - '"%MSBUILD%" /t:Rebuild'
        - '"%SONARSCANNER%" end'
    only:
        - master
    tags:
        - windows

sonarqube_preview_feature_job:
    stage: test
    script:
        - 'git config --global user.email "%GITLAB_USER_EMAIL%"'
        - 'git config --global user.name "%GITLAB_USER_NAME%"'
        - git checkout origin/master
        - git merge %CI_COMMIT_SHA% --no-commit --no-ff
        - 'copy /Y "%CS_CONFIG%.default" "%CS_CONFIG%"'
        - 'copy /Y "%SVC_CONFIG%.default" "%SVC_CONFIG%"'
        - '"%MSBUILD%" /t:Restore'        
        - '"%SONARSCANNER%" begin /k:"%PROJECT_KEY%" /v:"%PROJECT_VERSION%" /d:sonar.analysis.mode=preview /d:sonar.gitlab.commit_sha=%CI_COMMIT_SHA% /d:sonar.gitlab.project_id=%CI_PROJECT_ID% /d:sonar.gitlab.ref_name=%CI_COMMIT_REF_NAME%'
        - '"%MSBUILD%" /t:Rebuild'
        - '"%SONARSCANNER%" end'

    except:
        - master
        - tags
    tags:
        - windows

Я уже разместил репозиторий Common, от которого зависит проект myProjectCS, как подмодуль git, поэтому мне интересно, почему конвейер все еще не может найти проекты?

...