test yaml doppio progetto

This commit is contained in:
Samuele E. Locatelli
2021-03-26 21:25:10 +01:00
parent 96fbb963ec
commit 48acd4be39
+89 -39
View File
@@ -1,14 +1,17 @@
variables:
NUGET_PATH: 'C:\Tools\nuget.exe'
MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe'
ASPNET_MERGE_PATH: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools'
#hasSource: '& "$env:NUGET_PATH" sources list | find "`"Steamware Nexus`"" /C'
#hasSource: '0'
VERS_MAIN: '2.7'
REL_NUM: '4159'
VERS_NUMBER: '$VERS_MAIN.2103.$REL_NUM'
NUGET_PATH: 'C:\Tools\nuget.exe'
MSBUILD_PATH: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe'
ASPNET_MERGE_PATH: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools'
EXE_RELEASE_FOLDER: 'c:\Projetcs\Compiled\GPW\Release'
DEPLOY_FOLDER: 'c:\Projects\Deploy\GPW\Builds'
VERS_MAIN: '2.7'
REL_NUM: '4159'
VERS_NUMBER: '$VERS_MAIN.2103.$REL_NUM'
# EXE_RELEASE_FOLDER: 'YourApp\bin\Release'
# MSI_RELEASE_FOLDER: 'Setup\bin\Release'
# TEST_FOLDER: 'Tests\bin\Release'
# DEPLOY_FOLDER: 'P:\Projects\YourApp\Builds'
# NUNIT_PATH: 'C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe'
# Da approfondire:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/dotNET.gitlab-ci.yml
@@ -17,32 +20,14 @@ variables:
# https://docs.gitlab.com/ee/ci/quick_start/index.html
# https://docs.gitlab.com/ee/ci/yaml/
stages:
- build
- deploy
#build_job:
# stage: build
# script:
# - |-
# echo $env:hasSource
# if ($env:hasSource -eq 0)
# {
# $env:NUGET_PATH sources Add -Name "`"Steamware Nexus`"" -Source http://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" #-password "`"viaDante16`""
# }
# else
# {
# - '& "$env:NUGET_PATH" sources Update -Name "`"Steamware Nexus`"" -Source http://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""'
# }
# $env:NUGET_PATH restore
# #- '& "$env:NUGET_PATH" restore LPA.sln'
# $env:MSBUILD_PATH LPA/LPA.csproj /p:DeployOnBuild=true /p:Configuration=Release /p:OutputPath=bin/
build_job:
build_job_admin:
stage: build
# only:
# - tags # the build process will only be started by git tag commits
script:
- |
$hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C
@@ -55,15 +40,58 @@ build_job:
- '& "$env:NUGET_PATH" restore GPW.sln'
- '& "$env:MSBUILD_PATH" GPW_Admin/GPW_Admin.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /m'
- '& "$env:MSBUILD_PATH" GPW_Smart/GPW_Smart.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
# paths:
# - '.\sourcecode\project.sln\bin\Release\Publish\'
# - '.\sourcecode\project.sln\bin\Publish\'
deploy_job:
artifacts:
expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on
paths:
# - '$env:EXE_RELEASE_FOLDER\YourApp.exe' # saving exe to copy to deploy folder
# - '$env:MSI_RELEASE_FOLDER\YourApp Setup.msi' # saving msi to copy to deploy folder
# - '$env:TEST_FOLDER\' # saving entire Test project so NUnit can run tests
- '$env:EXE_RELEASE_FOLDER\GPW_Admin\' # saving entire Test project so NUnit can run tests
- '$env:DEPLOY_FOLDER\GPW_Admin\' # saving entire Test project so NUnit can run tests
build_job_bcode:
stage: build
# only:
# - tags # the build process will only be started by git tag commits
script:
- |
$hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C
if ($hasSource -eq 0) {
C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source http://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
} else {
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source http://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
}
echo $hasSource
- '& "$env:NUGET_PATH" restore GPW.sln'
- '& "$env:MSBUILD_PATH" GPW_Barcode/GPW_Barcode.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /m'
artifacts:
expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on
paths:
# - '$env:EXE_RELEASE_FOLDER\YourApp.exe' # saving exe to copy to deploy folder
# - '$env:MSI_RELEASE_FOLDER\YourApp Setup.msi' # saving msi to copy to deploy folder
# - '$env:TEST_FOLDER\' # saving entire Test project so NUnit can run tests
- '$env:EXE_RELEASE_FOLDER\GPW_Barcode\' # saving entire Test project so NUnit can run tests
- '$env:DEPLOY_FOLDER\GPW_Barcode\' # saving entire Test project so NUnit can run tests
# test_job:
# stage: test
# only:
# - tags
# script:
# - '& "$env:NUNIT_PATH" ".\$env:TEST_FOLDER\Tests.dll"' # running NUnit tests
# artifacts:
# when: always # save test results even when the task fails
# expire_in: 1 week # save gitlab server space, we copy the files we need to deploy folder later on
# paths:
# - '.\TestResult.xml' # saving NUnit results to copy to deploy folder
# dependencies:
# - build_job
deploy_job_admin:
stage: deploy
script:
- |
@@ -78,4 +106,26 @@ deploy_job:
- '& "$env:NUGET_PATH" restore GPW.sln'
- '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS01.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS01 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ GPW_Admin/GPW_Admin.csproj'
dependencies:
- build_job_admin
# - test_job
deploy_job_bcode:
stage: deploy
script:
- |
$hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C
if ($hasSource -eq 0) {
C:\Tools\nuget.exe sources Add -Name "`"Steamware Nexus`"" -Source http://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
} else {
C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source http://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`""
}
echo $hasSource
- '& "$env:NUGET_PATH" restore GPW.sln'
- '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS01.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS01 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ GPW_Barcode/GPW_Barcode.csproj'
dependencies:
- build_job_bcode
# - test_job