From 1d6788c89dd9b583cf196a30a128f81e07a8e589 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 10 Sep 2021 17:55:06 +0200 Subject: [PATCH 1/3] Release iniziale file yaml gitlab x CICD --- .gitlab-ci.yml | 327 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 327 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 00000000..19120681 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,327 @@ +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\MoonPro\Release' + DEPLOY_FOLDER: 'c:\Projects\Deploy\MoonPro\Builds' + VERS_MAIN: '2.8' + NEW_REL: '' +# VERS_MAIN: '1.0' + NEXUS_PATH: 'MoonPro' +# APP_NAME: 'MP.Stats' + + +# 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 +# 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/ + +# 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 + 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 + +# helper creazione hash files x IIS +.hashBuild: &hashBuild + - | + $Target = $env:APP_NAME + "\bin\publish\" + $env:APP_NAME + ".zip" + $MD5 = Get-FileHash $Target -Algorithm MD5 + $SHA1 = Get-FileHash $Target -Algorithm SHA1 + New-Item $Target".md5" + New-Item $Target".sha1" + $MD5.Hash | Set-Content -Path $Target".md5" + $SHA1.Hash | Set-Content -Path $Target".sha1" + + echo "Created HASH files for $Target" + +# helper x send su NEXUS x pack +.nexusUpload: &nexusUpload + - | + Set-Alias mCurl C:\Windows\system32\curl.exe + $currentDate = get-date -format yyMM; + $currentTime = get-date -format ddHH; + $VersNumb = Get-Content "Resources\VersNum.txt" + echo "Curr Version: $VersNumb" + if($CI_COMMIT_BRANCH -eq "master") + { + $version = "stable" + } + else + { + $version = "unstable" + } + $File2Send = Get-ChildItem($env:APP_NAME + "\bin\publish\*") + ForEach ($File in $File2Send) { + $FileName = Split-Path $File -leaf + mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File http://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/0/$FileName + mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File http://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/$VersNumb/$FileName + } + mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "Resources\manifest.xml" http://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/0/manifest.xml + mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "Resources\ChangeLog.html" http://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/0/ChangeLog.html + + + + +# helper x fix version number +.version-fix: &version-fix + - | + $env:NEW_REL = $env:VERS_MAIN+"."+(get-date –format yyMM)+"."+$CI_PIPELINE_IID + echo "Set vers: $env:NEW_REL" + $contenuto = Get-Content -path 'VersGen\MoonPro.cs' -Raw + $newContenuto = $contenuto -replace '0.0.0.0', $env:NEW_REL + $newContenuto | Set-Content -Path 'VersGen\MoonPro.cs' + +stages: + - build + - staging + - deploy + - installer + + +AC:build: + stage: build + tags: + - win + before_script: + - *nuget-fix + - '& "$env:NUGET_PATH" restore MAPO.sln' # path alla solution corrente + - *version-fix + script: + - '& "$env:MSBUILD_PATH" MP-ADM/MP-ADM.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m' + + - '& "$env:MSBUILD_PATH" MP-IO/MP-IO.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m' + + - '& "$env:MSBUILD_PATH" MP-SITE/MP-SITE.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m' + + + + +# \ cache: +# #key: ${CI_COMMIT_REF_SLUG} +# # key: ${CI_JOB_NAME} +# key: GPW-pack +# paths: +# - packages/ +# 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 + +BHS:build: + stage: build + tags: + - win + before_script: + - *nuget-fix + - '& "$env:NUGET_PATH" restore MAPO.sln' + - *version-fix + script: + - '& "$env:MSBUILD_PATH" MP-LAND/MP-LAND.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m' + + - '& "$env:MSBUILD_PATH" MP-MON/MP-MON.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m' + + - '& "$env:MSBUILD_PATH" MP-TAB/MP-TAB.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m' + + - '& "$env:MSBUILD_PATH" MP-MAG/MP-MAG.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m' + + +# 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 + + +AC:staging: + stage: staging + tags: + - win + rules: + - if: '$CI_COMMIT_BRANCH == "develop"' + before_script: + - *nuget-fix + - '& "$env:NUGET_PATH" restore MAPO.sln' + - *version-fix + script: + - '& "$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/ /verbosity:minimal MP-ADM/MP-ADM.csproj' + - '& "$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/ /verbosity:minimal MP-IO/MP-IO.csproj' + - '& "$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/ /verbosity:minimal MP-SITE/MP-SITE.csproj' + +# cache: +# #key: ${CI_COMMIT_REF_SLUG} +# # key: ${CI_JOB_NAME} +# key: GPW-pack +# paths: +# - packages/ +# policy: pull + needs: ["AC:build"] +# when: +# manual + +BHS:staging: + stage: staging + tags: + - win + rules: + - if: '$CI_COMMIT_BRANCH == "develop"' + before_script: + - *nuget-fix + - '& "$env:NUGET_PATH" restore GPW.sln' + - *version-fix + script: + - '& "$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/ /verbosity:minimal MP-LAND/MP-LAND.csproj' + - '& "$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/ /verbosity:minimal MP-MON/MP-MON.csproj' + - '& "$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/ /verbosity:minimal MP-TAB/MP-TAB.csproj' + - '& "$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/ /verbosity:minimal MP-MAG/MP-MAG.csproj' + needs: ["BHS:build"] + + +AC:deploy: + stage: deploy + tags: + - win + rules: + - if: '$CI_COMMIT_BRANCH == "master"' + before_script: + - *nuget-fix + - '& "$env:NUGET_PATH" restore MAPO.sln' + - *version-fix + script: + # ----Mapo ADM ---- + # IIS 02 + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS02.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal MP-ADM/MP-ADM.csproj' + # IIS DEV + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IISDEV.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal MP-ADM/MP-ADM.csproj' + # ----Mapo IO ---- + # IIS 02 + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS02.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal MP-IO/MP-IO.csproj' + # IIS DEV + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IISDEV.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal MP-IO/MP-IO.csproj' + # ----Mapo SITE ---- + # IIS 02 + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS02.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal MP-SITE/MP-SITE.csproj' + # IIS DEV + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IISDEV.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal MP-SITE/MP-SITE.csproj' + + needs: ["AC:build"] +# when: +# manual + +BHS:deploy: + stage: deploy + tags: + - win + rules: + - if: '$CI_COMMIT_BRANCH == "master"' + before_script: + - *nuget-fix + - '& "$env:NUGET_PATH" restore MAPO.sln' + - *version-fix + script: + # ----Mapo LAND ---- + # IIS 02 + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS02.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal MP-LAND/MP-LAND.csproj' + # IIS DEV + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IISDEV.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal MP-LAND/MP-LAND.csproj' + # ---- Mapo MON ---- + # IIS 02 + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS02.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal MP-MON/MP-MON.csproj' + # IIS DEV + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IISDEV.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal MP-MON/MP-MON.csproj' + # ---- Mapo TAB ---- + # IIS 02 + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS02.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal MP-TAB/MP-TAB.csproj' + # IIS DEV + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IISDEV.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal MP-TAB/MP-TAB.csproj' + # ---- Mapo MAG ---- + # IIS 02 + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS02.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal MP-MAG/MP-MAG.csproj' + # IIS DEV + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IISDEV.pubxml /p:RunCodeAnalysis=false /p:Configuration=IIS02 /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal MP-MAG/MP-MAG.csproj' + + needs: ["BHS:build"] + +AC:install: + stage: installer + tags: + - win + rules: + - if: '$CI_COMMIT_BRANCH == "master"' + when: manual +# only: +# - tags # the build process will only be started by git tag commits + before_script: + - *nuget-fix + - '& "$env:NUGET_PATH" restore MAPO.sln' + - *version-fix + script: + # ADM ZIP package + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/MAPO_PROD/$env:NEW_REL/ADM.zip /p:DeployIisAppPath="Default Web Site/GPW/ADMIN" /p:PackageAsSingleFile=True /p:OutputPath=bin/ GPW_Admin/GPW_Admin.csproj' + - *hashBuild + - *nexusUpload + # IO ZIP package + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/MAPO_PROD/$env:NEW_REL/IO.zip /p:DeployIisAppPath="Default Web Site/GPW/ADMIN" /p:PackageAsSingleFile=True /p:OutputPath=bin/ GPW_Commesse/GPW_Commesse.csproj' + - *hashBuild + - *nexusUpload + # SITE ZIP package + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/MAPO_PROD/$env:NEW_REL/SITE.zip /p:DeployIisAppPath="Default Web Site/GPW/ADMIN" /p:PackageAsSingleFile=True /p:OutputPath=bin/ GPW_Commesse/GPW_Commesse.csproj' + - *hashBuild + - *nexusUpload + needs: ["AC:build"] + + +BHS:install: + stage: installer + tags: + - win + rules: + - if: '$CI_COMMIT_BRANCH == "master"' + when: manual + before_script: + - *nuget-fix + - '& "$env:NUGET_PATH" restore MAPO.sln' + - *version-fix + script: + # LAND ZIP package + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/MAPO_PROD/$env:NEW_REL/LAND.zip /p:DeployIisAppPath="Default Web Site/GPW/ADMIN" /p:PackageAsSingleFile=True /p:OutputPath=bin/ GPW_Barcode/GPW_Barcode.csproj' + - *hashBuild + - *nexusUpload + # MON ZIP package + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/MAPO_PROD/$env:NEW_REL/MON.zip /p:DeployIisAppPath="Default Web Site/GPW/ADMIN" /p:PackageAsSingleFile=True /p:OutputPath=bin/ HOME/HOME.csproj' + - *hashBuild + - *nexusUpload + # TAB package + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/MAPO_PROD/$env:NEW_REL/TAB.zip /p:DeployIisAppPath="Default Web Site/GPW/ADMIN" /p:PackageAsSingleFile=True /p:OutputPath=bin/ GPW_Smart/GPW_Smart.csproj' + - *hashBuild + - *nexusUpload + # MAG package + - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /T:Package /P:Configuration=SPS /p:PublishProfile=SPS.pubxml /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/MAPO_PROD/$env:NEW_REL/MAG.zip /p:DeployIisAppPath="Default Web Site/GPW/ADMIN" /p:PackageAsSingleFile=True /p:OutputPath=bin/ GPW_Smart/GPW_Smart.csproj' + - *hashBuild + - *nexusUpload + + needs: ["BHS:build"] From a5bb3f72856712fc4ba5e566fd6e03e30fbd16e2 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 10 Sep 2021 18:17:07 +0200 Subject: [PATCH 2/3] Inizio gestione fix gitlab --- .gitlab-ci.yml | 50 ++++++++++++++++++-------------------------------- 1 file changed, 18 insertions(+), 32 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 19120681..6c3899dd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,11 +4,10 @@ variables: ASPNET_MERGE_PATH: 'C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools' EXE_RELEASE_FOLDER: 'c:\Projetcs\Compiled\MoonPro\Release' DEPLOY_FOLDER: 'c:\Projects\Deploy\MoonPro\Builds' - VERS_MAIN: '2.8' + VERS_MAIN: '6.13' NEW_REL: '' -# VERS_MAIN: '1.0' - NEXUS_PATH: 'MoonPro' -# APP_NAME: 'MP.Stats' + NEXUS_PATH: 'MP' + APP_NAME: 'MP-XXX' # VARIABILI @@ -53,7 +52,7 @@ variables: Set-Alias mCurl C:\Windows\system32\curl.exe $currentDate = get-date -format yyMM; $currentTime = get-date -format ddHH; - $VersNumb = Get-Content "Resources\VersNum.txt" + $VersNumb = $env:NEW_REL echo "Curr Version: $VersNumb" if($CI_COMMIT_BRANCH -eq "master") { @@ -66,11 +65,11 @@ variables: $File2Send = Get-ChildItem($env:APP_NAME + "\bin\publish\*") ForEach ($File in $File2Send) { $FileName = Split-Path $File -leaf - mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File http://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/0/$FileName - mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File http://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/$VersNumb/$FileName + mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File http://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$env:APP_NAME/$version/0/$FileName + mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file $File http://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$env:APP_NAME/$version/$VersNumb/$FileName } - mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "Resources\manifest.xml" http://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/0/manifest.xml - mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "Resources\ChangeLog.html" http://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/0/ChangeLog.html + mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "Resources\manifest.xml" http://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$env:APP_NAME/$version/0/manifest.xml + mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "Resources\ChangeLog.html" http://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$env:APP_NAME/$version/0/ChangeLog.html @@ -78,7 +77,7 @@ variables: # helper x fix version number .version-fix: &version-fix - | - $env:NEW_REL = $env:VERS_MAIN+"."+(get-date –format yyMM)+"."+$CI_PIPELINE_IID + $env:NEW_REL = $env:VERS_MAIN+"."+(get-date –format yyMM)+"."+(get-date –format dHH) echo "Set vers: $env:NEW_REL" $contenuto = Get-Content -path 'VersGen\MoonPro.cs' -Raw $newContenuto = $contenuto -replace '0.0.0.0', $env:NEW_REL @@ -91,8 +90,10 @@ stages: - installer -AC:build: +AIS:build: stage: build + variables: + CURR_PRJ: "MP-ADM" tags: - win before_script: @@ -101,9 +102,7 @@ AC:build: - *version-fix script: - '& "$env:MSBUILD_PATH" MP-ADM/MP-ADM.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m' - - '& "$env:MSBUILD_PATH" MP-IO/MP-IO.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m' - - '& "$env:MSBUILD_PATH" MP-SITE/MP-SITE.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m' @@ -124,7 +123,7 @@ AC:build: # - '$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 -BHS:build: +LMMT:build: stage: build tags: - win @@ -133,12 +132,9 @@ BHS:build: - '& "$env:NUGET_PATH" restore MAPO.sln' - *version-fix script: - - '& "$env:MSBUILD_PATH" MP-LAND/MP-LAND.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m' - + - '& "$env:MSBUILD_PATH" MP-LAND/MP-LAND.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m' - '& "$env:MSBUILD_PATH" MP-MON/MP-MON.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m' - - '& "$env:MSBUILD_PATH" MP-TAB/MP-TAB.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m' - - '& "$env:MSBUILD_PATH" MP-MAG/MP-MAG.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m' @@ -157,7 +153,7 @@ BHS:build: # - build_job -AC:staging: +AIS:staging: stage: staging tags: - win @@ -171,19 +167,9 @@ AC:staging: - '& "$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/ /verbosity:minimal MP-ADM/MP-ADM.csproj' - '& "$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/ /verbosity:minimal MP-IO/MP-IO.csproj' - '& "$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/ /verbosity:minimal MP-SITE/MP-SITE.csproj' + needs: ["AIS:build"] -# cache: -# #key: ${CI_COMMIT_REF_SLUG} -# # key: ${CI_JOB_NAME} -# key: GPW-pack -# paths: -# - packages/ -# policy: pull - needs: ["AC:build"] -# when: -# manual - -BHS:staging: +LMMT:staging: stage: staging tags: - win @@ -198,7 +184,7 @@ BHS:staging: - '& "$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/ /verbosity:minimal MP-MON/MP-MON.csproj' - '& "$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/ /verbosity:minimal MP-TAB/MP-TAB.csproj' - '& "$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/ /verbosity:minimal MP-MAG/MP-MAG.csproj' - needs: ["BHS:build"] + needs: ["LMMT:build"] AC:deploy: From 4eec0d3bb13f48d49899894fc83f9dd267ca6ec8 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Mon, 13 Sep 2021 11:25:42 +0200 Subject: [PATCH 3/3] Rimesso in web.config timeout sessione TAB esplicito --- MP-TAB/Web.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MP-TAB/Web.config b/MP-TAB/Web.config index 24d27747..639732be 100644 --- a/MP-TAB/Web.config +++ b/MP-TAB/Web.config @@ -30,7 +30,7 @@ - +