Update .gitlab-ci.yml

This commit is contained in:
gitlab
2021-03-24 14:26:52 +00:00
parent 22bda60baa
commit fc45f8e7c8
+3 -14
View File
@@ -1,17 +1,15 @@
variables:
NUGET_PATH: 'C:\Tools\nuget.exe'
MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe'
MSTEST_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\mstest.exe'
TEST_FOLDER: '.\test\bin\Release'
stages:
- build
- test
- deploy
before_script:
- '& "$env:NUGET_PATH" restore sourcecode\project.sln' # sourcecode\project.sln-This path includes project solution where is available and restoring
- '& "$env:NUGET_PATH" restore test\test.sln' # This path includes test solution where is available. and restoring
build_job:
stage: build
@@ -19,22 +17,14 @@ build_job:
- developer #this branch will run on GitLab Runner and can change it.
script:
- '& "$env:MSBUILD_PATH" sourcecode\project.sln /p:DeployOnBuild=true /p:Configuration=Release /p:Platform="Any CPU" /P:PublishProfile=FolderProfile.pubxml'
- '& "$env:MSBUILD_PATH" test\test.sln /p:DeployOnBuild=true /p:Configuration=Release /p:Platform="Any CPU" /P:PublishProfile=FolderProfile.pubxml'
- bat "\$env:MSBUILD_PATH" LPA/LPA.csproj -target:Build /p:Configuration=Release /p:Platform=\"Any CPU\" /p:OutputPath=bin/ /m"
artifacts:
expire_in: 365 days #artifcats will be stored only 365 days after this it will expire
paths:
- '.\sourcecode\project.sln\bin\Release\Publish\'
- '.\sourcecode\project.sln\bin\Publish\'
- '$env:TEST_FOLDER'
- '.\$env:MSTEST_PATH\*.*'
test_job:
stage: test
only:
- developer #this branch will run on GitLab Runner and can change it.
script:
- .\test\test.bat #This is bat file, if the test are written in script format
dependencies:
- build_job
@@ -49,4 +39,3 @@ deploy_job:
dependencies: #after successfully build, only test stage will run
- build_job
- test_job