2016-11-21 1 views
1

.net 프로젝트 용 GitLab CI를 설정하려고합니다. 이제 yml 파일에 스크립트를 작성하고 있습니다. 내가 알고 싶은 것 : msbuild.exe와 mstest.exe의 경로가 다른 팀원마다 다를 수 있습니다. 동일한 yml 스크립트가 다른 사용자에게 어떻게 적용될 수 있습니까?
GitLab CI가 잘못된 방식으로 작동하는 방식을 알고있을 수 있습니까?GitLab CI. 다른 사용자의 yml 경로

답변

2

mstest.exe 및 다른 모든 참조 된 실행 파일 및 파일의 경로는 GitLab 실행 프로그램이 실행되는 컴퓨터를 기반으로합니다.

컴퓨터에있는 항목이나 다른 사람의 것이 중요하지 않습니다. 빌드 서버 만 중요하므로 gitlab .yml을 적절히 작성하십시오. 이 주자에서 실행 중일 때

샘플 .NET의 YML 파일
##variables: 
## increase indentation carefully, one space per cascade level. 
## THIS IS YAML. NEVER USE TABS. 
stages: 
    - build 
    - deploy 

#BUILD 
# Builds all working branches 
working: 
    stage: build 
    except: 
    - master 
    script: 
    - echo "Build Stage" 
    - echo "Restoring NuGet Packages..." 
    - '"c:\nuget\nuget.exe" restore "SOLUTION PATH"' 
    # - '"c:\nuget\nuget.exe" restore "ANOTHER ABSOLUTE PATH TO YOUR SOLUTION"' 
    - '' 
    - echo "Building Solutions..." 
    - C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe /consoleloggerparameters:ErrorsOnly /maxcpucount /nologo /property:Configuration=Release /verbosity:quiet "SOLUTION PATH" 

# Builds all stable/master pushes 
stable: 
    stage: build 
    only: 
    - master 
    script: 
    - echo "Build Stage" 
    - echo "Restoring NuGet Packages..." 
    - '"c:\nuget\nuget.exe" restore "SOLUTION PATH"' 
    # - '"c:\nuget\nuget.exe" restore "ANOTHER ABSOLUTE PATH TO YOUR SOLUTION"' 
    - '' 
    - echo "Building Solutions..." 
    - C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe /consoleloggerparameters:ErrorsOnly /maxcpucount /nologo /property:Configuration=Release /verbosity:quiet "SOLUTION PATH" 




#DEPLOY 

    stage: deploy 
    only: 
    - dev 
    script: 
    - echo "Deploy Stage" 
#SEND TO YOUR DEV SERVER 


    ## deploy latest master to the correct servers 
    stage: deploy 

    script: 
    - echo "Deploy Stage" 
    only: 
    - master 
#SEND TO YOUR PRODUCTION SERVER 

    tags: 
    - .NET 
    #put tags here you put on your runners so you can hit the right runners when you push your code. 
+0

는 어디에서 해결책 PATH를 찾을 수 있습니까? –

+1

솔루션 경로는 구축중인 솔루션의 경로입니다. 당신은 gitlab-ci.yml에 상대적으로 그것을 쓸 수있다. 그것은 당신이 원하는 솔루션에 대한 경로입니다. 나중에 참조하기를 원한다면 미리 정의 된 gitlab 환경 변수를 살펴 봐야한다. https://docs.gitlab.com/ee/ci/variables/#predefined-variables-environment-variables –

+0

배포 예제가 있습니까? –