Answer the question
In order to leave comments, you need to log in
How to link Gitlab CI and Visual Studio projects?
Hi all.
There is a configured GitLab server used to share Git repositories. There was a desire to set up Gitlab CI to automatically build Visual Studio projects, and in the future - to run tests.
I set up both products, installed runner for Windows and MSBuild on a separate server. And stalled on writing a Job Script to build the application.
Has anyone done similar?
Answer the question
In order to leave comments, you need to log in
I will answer myself, here is an example job script for building Release and Debug configurations, with restoring packages from Nuget (e3Shell.Extensions.sln is the name of the solution file):
git submodule update --init
ls -la
echo "Restoring NuGet Packages..."
"c:\nuget\nuget.exe" restore "e3Shell.Extensions.sln"
echo "Debug build..."
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe /consoleloggerparameters:ErrorsOnly /maxcpucount /nologo /property:Configuration=Debug /verbosity:quiet "e3Shell.Extensions.sln"
echo "Release build..."
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe /consoleloggerparameters:ErrorsOnly /maxcpucount /nologo /property:Configuration=Release /verbosity:quiet "e3Shell.Extensions.sln"
echo "Build success."
stages:
- build
job:
stage: build
script:
- git submodule update --init
- ls -la
- ''
- echo "Restoring NuGet Packages..."
- '"c:\nuget\nuget.exe" restore "TerminalClone.sln"'
- ''
- echo "Debug build..."
- C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe /consoleloggerparameters:ErrorsOnly
/maxcpucount /nologo /property:Configuration=Debug /verbosity:quiet "TerminalClone.sln"
- ''
- echo "Release build..."
- C:\Windows\Microsoft.NET\Framework64\v4.0.30319\msbuild.exe /consoleloggerparameters:ErrorsOnly
/maxcpucount /nologo /property:Configuration=Release /verbosity:quiet "TerminalClone.sln"
- ''
- echo "Build success."
tags:
except:
- tags
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question