From 2af4c5c64f525da007ed888986c1eaefba31fa55 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 26 Mar 2021 18:41:53 +0100 Subject: [PATCH 01/15] fix filename yaml --- gitlab-ci.yml => .gitlab-ci.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename gitlab-ci.yml => .gitlab-ci.yml (100%) diff --git a/gitlab-ci.yml b/.gitlab-ci.yml similarity index 100% rename from gitlab-ci.yml rename to .gitlab-ci.yml From a10fd5f54cd9a0022994522559b241baf7fb2fbc Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 26 Mar 2021 18:51:22 +0100 Subject: [PATCH 02/15] update yaml --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 918af0c..4bd8e8b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,7 +40,7 @@ build_job: echo $hasSource - '& "$env:NUGET_PATH" restore GPW.sln' - - '& "$env:MSBUILD_PATH" GPW/GPW.csproj /p:DeployOnBuild=true /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=sourcecode/' + - '& "$env:MSBUILD_PATH" GPW_Admin/GPW_Admin.csproj /p:DeployOnBuild=true /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=sourcecode/' #artifacts: # expire_in: 365 days #artifcats will be stored only 365 days after this it will From fda73cc0c611257e348dbcbff2d89b1338505393 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 26 Mar 2021 19:00:14 +0100 Subject: [PATCH 03/15] refresh yaml --- .gitlab-ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4bd8e8b..5eebbf8 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,7 +40,8 @@ build_job: echo $hasSource - '& "$env:NUGET_PATH" restore GPW.sln' - - '& "$env:MSBUILD_PATH" GPW_Admin/GPW_Admin.csproj /p:DeployOnBuild=true /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=sourcecode/' + - '& "$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 From 0c2200e6f1bfcd86761a973ac2398310ef3b2075 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 26 Mar 2021 19:02:13 +0100 Subject: [PATCH 04/15] ancora fix deploy --- .gitlab-ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5eebbf8..08ba6d7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -52,4 +52,6 @@ build_job: deploy_job: stage: deploy script: - - 'xcopy /y /s ".\sourcecode\*.*" "C:\solutionDir"' #Path where you want to store the solution + #- 'xcopy /y /s ".\sourcecode\*.*" "C:\solutionDir"' #Path where you want to store the solution + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /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' + \ No newline at end of file From decc0a2196ed46eba479c451514cdebc6db2db46 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 26 Mar 2021 19:03:55 +0100 Subject: [PATCH 05/15] fix escape any cpu --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 08ba6d7..235ca9b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,8 +40,8 @@ build_job: echo $hasSource - '& "$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' + - '& "$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 From a4fe527ad5a290c5fb2109a748ea6897c59849c6 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 26 Mar 2021 19:09:41 +0100 Subject: [PATCH 06/15] ancora update yaml --- .gitlab-ci.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 235ca9b..caac109 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,6 +1,7 @@ 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' @@ -52,6 +53,16 @@ build_job: deploy_job: stage: deploy script: - #- 'xcopy /y /s ".\sourcecode\*.*" "C:\solutionDir"' #Path where you want to store the solution - - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /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' + - | + $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_Admin/GPW_Admin.csproj' \ No newline at end of file From 96fbb963ec4865de1a6dcd0466a2e7b251d9a383 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 26 Mar 2021 19:30:47 +0100 Subject: [PATCH 07/15] update yaml --- .gitlab-ci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index caac109..f8bfaee 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,6 +4,19 @@ variables: 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' + + + +# Da approfondire: +# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/dotNET.gitlab-ci.yml +# https://www.google.com/search?q=gitlab+variable+year+month&rlz=1C1GCEA_enIT945IT945&oq=gitlab+variable+year+month&aqs=chrome..69i57j69i64.5262j0j7&sourceid=chrome&ie=UTF-8 +# https://docs.gitlab.com/ee/ci/examples/README.html +# https://docs.gitlab.com/ee/ci/quick_start/index.html +# https://docs.gitlab.com/ee/ci/yaml/ + stages: From 48acd4be3900fe95ea5cfadbd0944a5eb1918818 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 26 Mar 2021 21:25:10 +0100 Subject: [PATCH 08/15] test yaml doppio progetto --- .gitlab-ci.yml | 128 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 89 insertions(+), 39 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f8bfaee..ee0a340 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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 \ No newline at end of file From fb45c1964d179359d21cab72a19bb86c29c5acec Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 26 Mar 2021 21:32:23 +0100 Subject: [PATCH 09/15] fix space syntax --- .gitlab-ci.yml | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ee0a340..a10f903 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,17 +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' - 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' + 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 @@ -40,8 +40,7 @@ build_job_admin: - '& "$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' - - artifacts: + 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 @@ -67,7 +66,7 @@ build_job_bcode: - '& "$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: + 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 @@ -106,7 +105,7 @@ deploy_job_admin: - '& "$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: + dependencies: - build_job_admin # - test_job @@ -125,7 +124,7 @@ deploy_job_bcode: - '& "$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: + dependencies: - build_job_bcode # - test_job \ No newline at end of file From 1ceb09cc2751dc22e764668dd8aa1b289ac82899 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 26 Mar 2021 21:43:46 +0100 Subject: [PATCH 10/15] test speedup? --- .gitlab-ci.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a10f903..d22e8be 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,7 +24,7 @@ stages: - build - deploy -build_job_admin: +admin:build: stage: build # only: # - tags # the build process will only be started by git tag commits @@ -49,7 +49,7 @@ build_job_admin: - '$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: +bcode:build: stage: build # only: # - tags # the build process will only be started by git tag commits @@ -90,7 +90,7 @@ build_job_bcode: # - build_job -deploy_job_admin: +admin:deploy: stage: deploy script: - | @@ -105,11 +105,12 @@ deploy_job_admin: - '& "$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' + needs: ["admin:build"] dependencies: - - build_job_admin + - admin:build # - test_job -deploy_job_bcode: +bcode:deploy: stage: deploy script: - | @@ -124,7 +125,8 @@ deploy_job_bcode: - '& "$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' + needs: ["bcode:build"] dependencies: - - build_job_bcode + - bcode:build # - test_job \ No newline at end of file From 3b648d967ea37bad78e4d1d0ec48052669623cf6 Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 26 Mar 2021 21:58:21 +0100 Subject: [PATCH 11/15] test nuget script --- .gitlab-ci.yml | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d22e8be..8a56a35 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,15 +20,8 @@ variables: # https://docs.gitlab.com/ee/ci/quick_start/index.html # https://docs.gitlab.com/ee/ci/yaml/ -stages: - - build - - deploy -admin:build: - stage: build -# only: -# - tags # the build process will only be started by git tag commits - script: +.nuget-fix: &nuget-fix - | $hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C if ($hasSource -eq 0) { @@ -38,6 +31,26 @@ admin:build: } echo $hasSource +stages: + - build + - deploy + +admin:build: + stage: build +# only: +# - tags # the build process will only be started by git tag commits + before_script: + - *nuget-fix + 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_Admin/GPW_Admin.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /m' artifacts: From 6d8007af49a2dfa583e83ee12283e0bfeb242ace Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 26 Mar 2021 22:16:58 +0100 Subject: [PATCH 12/15] ancora test yaml functions --- .gitlab-ci.yml | 102 +++++++++++++++++-------------------------------- 1 file changed, 34 insertions(+), 68 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8a56a35..2a57515 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -20,7 +20,7 @@ variables: # https://docs.gitlab.com/ee/ci/quick_start/index.html # https://docs.gitlab.com/ee/ci/yaml/ - +# helper x fix pacchetti nuget da repo locale nexus.steamware.net .nuget-fix: &nuget-fix - | $hasSource = C:\Tools\nuget.exe sources list | find "`"Steamware Nexus`"" /C @@ -30,6 +30,8 @@ variables: C:\Tools\nuget.exe sources Update -Name "`"Steamware Nexus`"" -Source http://nexus.steamware.net/repository/nuget-group -username "`"nugetUser`"" -password "`"viaDante16`"" } echo $hasSource + # path alla solution corrente + - '& "$env:NUGET_PATH" restore GPW.sln' stages: - build @@ -37,56 +39,34 @@ stages: admin:build: stage: build -# only: -# - tags # the build process will only be started by git tag commits before_script: - *nuget-fix 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_Admin/GPW_Admin.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_Admin\' # saving entire Test project so NUnit can run tests - - '$env:DEPLOY_FOLDER\GPW_Admin\' # saving entire Test project so NUnit can run tests +# 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 bcode:build: 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' + before_script: + - *nuget-fix + script: - '& "$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 +# 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 @@ -105,19 +85,14 @@ bcode:build: admin:deploy: 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_Admin/GPW_Admin.csproj' +# rules: +# - if: '$CI_COMMIT_BRANCH == "develop"' +# only: +# - tags # the build process will only be started by git tag commits + before_script: + - *nuget-fix + script: + - '& "$env:MSBUILD_PATH" /p:m=4 /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' needs: ["admin:build"] dependencies: - admin:build @@ -125,19 +100,10 @@ admin:deploy: bcode:deploy: 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' + before_script: + - *nuget-fix + script: + - '& "$env:MSBUILD_PATH" /p:m=4 /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' needs: ["bcode:build"] dependencies: - bcode:build From 82f18255122dec03d5570acb64e7ac4ec8490e8e Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 26 Mar 2021 22:18:50 +0100 Subject: [PATCH 13/15] typo fix --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 2a57515..e8bc592 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -89,7 +89,7 @@ admin:deploy: # - if: '$CI_COMMIT_BRANCH == "develop"' # only: # - tags # the build process will only be started by git tag commits - before_script: + before_script: - *nuget-fix script: - '& "$env:MSBUILD_PATH" /p:m=4 /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' @@ -100,7 +100,7 @@ admin:deploy: bcode:deploy: stage: deploy - before_script: + before_script: - *nuget-fix script: - '& "$env:MSBUILD_PATH" /p:m=4 /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' From c9bebec867318b42173e8bebbee0d9c844e3ef2d Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 26 Mar 2021 23:21:59 +0100 Subject: [PATCH 14/15] test vers numb --- .gitlab-ci.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e8bc592..3a18f63 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -6,13 +6,18 @@ variables: DEPLOY_FOLDER: 'c:\Projects\Deploy\GPW\Builds' VERS_MAIN: '2.7' REL_NUM: '4159' - VERS_NUMBER: '$VERS_MAIN.2103.$REL_NUM' + VERS_NUMBER: '$VERS_MAIN.2103.$CI_PIPELINE_IID' # 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' +# VARIABILI +# Tema numero versione: si potrebbe usare la variabile CI_COMMIT_TAG con $env:CI_COMMIT_TAG, in questo caso SOLO SE c'รจ un tag sistema versione... +# Tema compilazione x branch: $CI_COMMIT_BRANCH == "my-branch" potrebbe essere condizione if x fare alcuni sscript... +# rif: https://docs.gitlab.com/ee/ci/variables/predefined_variables.html + # Da approfondire: # https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/dotNET.gitlab-ci.yml # https://www.google.com/search?q=gitlab+variable+year+month&rlz=1C1GCEA_enIT945IT945&oq=gitlab+variable+year+month&aqs=chrome..69i57j69i64.5262j0j7&sourceid=chrome&ie=UTF-8 @@ -20,6 +25,8 @@ variables: # https://docs.gitlab.com/ee/ci/quick_start/index.html # https://docs.gitlab.com/ee/ci/yaml/ + + # helper x fix pacchetti nuget da repo locale nexus.steamware.net .nuget-fix: &nuget-fix - | @@ -33,6 +40,9 @@ variables: # path alla solution corrente - '& "$env:NUGET_PATH" restore GPW.sln' +.versNumbFix: &versNumbFix + - echo $env:VERS_NUMBER + stages: - build - deploy From 8a82d017016b235834774dcd76a29ea085b513bb Mon Sep 17 00:00:00 2001 From: "Samuele E. Locatelli" Date: Fri, 26 Mar 2021 23:34:26 +0100 Subject: [PATCH 15/15] refresh --- .gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3a18f63..871a227 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -40,8 +40,9 @@ variables: # path alla solution corrente - '& "$env:NUGET_PATH" restore GPW.sln' -.versNumbFix: &versNumbFix - - echo $env:VERS_NUMBER +# .versNumbFix: &versNumbFix +# - 'echo "Set vers: $env:VERS_NUMBER"' +# - '& ((Get-Content -path VersGen\\GPW.cs -Raw) -replace '0.0.0.0','$env:VERS_NUMBER') | Set-Content -Path VersGen\\GPW.cs?' stages: - build