From 442bac04ab1074e15f966273ff1fd97cab9ff875 Mon Sep 17 00:00:00 2001 From: Samuele Locatelli Date: Fri, 31 May 2024 17:15:03 +0200 Subject: [PATCH] Aggiunti file config x nuspec + modifica CI/CD yaml --- .gitlab-ci.yml | 92 +++++++++++++++++++++++++++++++++++++++--- MP.Land.Debug.nuspec | 28 +++++++++++++ MP.Land.Release.nuspec | 27 +++++++++++++ 3 files changed, 141 insertions(+), 6 deletions(-) create mode 100644 MP.Land.Debug.nuspec create mode 100644 MP.Land.Release.nuspec diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 347cdf03..dc4150b0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -76,6 +76,29 @@ variables: mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "$env:APP_NAME\Resources\manifest.xml" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/manifest.xml mCurl -v -u GitLab:$NEXUS_PASSWD --upload-file "$env:APP_NAME\Resources\ChangeLog.html" https://nexus.steamware.net/repository/SWS/$env:NEXUS_PATH/$version/LAST/ChangeLog.html +# helper x fix nuspec file +.nuspec-fix: &nuspec-fix + - | + echo "Modifica dati file nuspec Release" + $currRelease = $env:NUM_REL + $currDebug = $env:NUM_DEB + $find = "(.|\n)*?"; + $fileNameRel = "$env:APP_NAME.Release.nuspec"; + $replRel = "" + $currRelease + ""; + $nuspDataRel = Get-Content $fileNameRel; + $nuspDataRelUpd = $nuspDataRel -replace $find, $replRel; + $nuspDataRelUpd = $nuspDataRelUpd -replace "#copyright#", $replCopy; + $nuspDataRelUpd = $nuspDataRelUpd -replace "#releaseNotes#", "Build $adesso"; + Set-Content -Path $fileNameRel -Value $nuspDataRelUpd; + echo "Modifica dati file nuspec Debug" + $fileNameDeb = "$env:APP_NAME.Debug.nuspec"; + $replDeb = "" + $currDebug + ""; + $nuspDataDeb = Get-Content $fileNameDeb; + $nuspDataDebUpd = $nuspDataDeb -replace $find, $replDeb; + $nuspDataDebUpd = $nuspDataDebUpd -replace "#copyright#", $replCopy; + $nuspDataDebUpd = $nuspDataDebUpd -replace "#releaseNotes#", "Build $adesso"; + Set-Content -Path $fileNameDeb -Value $nuspDataDebUpd; + echo "replace completati" # Stages previsti stages: @@ -84,7 +107,9 @@ stages: - installer - release -# ----- Start BUILD ----- +# -------------------------------- +# BUILD +# -------------------------------- LAND:build: stage: build tags: @@ -249,7 +274,9 @@ TAB3:build: - dotnet build $env:APP_NAME/$env:APP_NAME.csproj -# ----- Start DEPLOY develop (IIS01) ----- +# -------------------------------- +# DEPLOY develop (IIS01 + beta nuget) +# -------------------------------- LAND:IIS01:deploy: stage: deploy tags: @@ -268,7 +295,31 @@ LAND:IIS01:deploy: script: - dotnet build $env:APP_NAME/$env:APP_NAME.csproj - dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj - + +LAND:SDK:deploy: + stage: deploy + tags: + - win + variables: + APP_NAME: MP.AppAuth + SOL_NAME: MP-LAND + before_script: + - *nuget-fix + - dotnet restore "$env:SOL_NAME.sln" + rules: + - if: $CI_COMMIT_BRANCH == 'develop' + - if: $CI_COMMIT_BRANCH =~ /^feature\/LAND.+/ + when: always + needs: ["LAND:build"] + script: + - dotnet build $env:APP_NAME/$env:APP_NAME.csproj + - '& Remove-Item *.nupkg' + - '& $env:NUGET_PATH pack "$env:APP_NAME.Debug.nuspec"' + - '& "$env:NUGET_PATH" setapikey $NUGET_API_KEY -source http://nexus.steamware.net/repository/nuget-hosted' + - '& "$env:NUGET_PATH" push *$env:NUM_DEB.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted' + + + PROG:IIS01:deploy: stage: deploy tags: @@ -421,7 +472,9 @@ TAB3:IIS01:deploy: - dotnet build $env:APP_NAME/$env:APP_NAME.csproj - dotnet publish -p:PublishProfile=IIS01.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj -# ----- Start DEPLOY master (IIS03/IIS04) ----- +# -------------------------------- +# DEPLOY master (IIS03/IIS04) +# -------------------------------- LAND:IIS03:deploy: stage: deploy tags: @@ -584,7 +637,9 @@ TAB3:IIS03:deploy: - dotnet publish -p:PublishProfile=IIS03.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj - dotnet publish -p:PublishProfile=IIS04.pubxml -p:RunCodeAnalysis=false -p:Configuration=Release -p:username=jenkins -p:Password=$IIS_PWD -p:AllowUntrustedCertificate=true -p:verbosity=quiet $env:APP_NAME/$env:APP_NAME.csproj -# ----- Start INSTALLER (develop/master) ----- +# -------------------------------- +# INSTALLER (develop/master) +# -------------------------------- LAND:installer: stage: installer tags: @@ -783,7 +838,9 @@ IOC:installer: - *hashBuild - *nexusUpload -# ----- Start RELEASE (tags only) ----- +# -------------------------------- +# RELEASE (tags only + sdk) +# -------------------------------- LAND:release: stage: release tags: @@ -805,6 +862,29 @@ LAND:release: - dotnet build $env:APP_NAME/$env:APP_NAME.csproj - dotnet publish -c Release -o ./publish $env:APP_NAME/$env:APP_NAME.csproj -p:verbosity=quiet + +LAND:SDK:release: + stage: deploy + tags: + - win + variables: + APP_NAME: MP.AppAuth + SOL_NAME: MP-LAND + before_script: + - *nuget-fix + - dotnet restore "$env:SOL_NAME.sln" + rules: + - if: $CI_COMMIT_BRANCH == 'develop' + - if: $CI_COMMIT_BRANCH =~ /^feature\/LAND.+/ + when: always + needs: ["LAND:build"] + script: + - dotnet build $env:APP_NAME/$env:APP_NAME.csproj + - '& Remove-Item *.nupkg' + - '& $env:NUGET_PATH pack "$env:APP_NAME.Release.nuspec"' + - '& "$env:NUGET_PATH" setapikey $NUGET_API_KEY -source http://nexus.steamware.net/repository/nuget-hosted' + - '& "$env:NUGET_PATH" push *$env:NUM_REL.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted' + PROG:release: stage: release tags: diff --git a/MP.Land.Debug.nuspec b/MP.Land.Debug.nuspec new file mode 100644 index 00000000..3099b248 --- /dev/null +++ b/MP.Land.Debug.nuspec @@ -0,0 +1,28 @@ + + + + MP.AppAuth + #version# + MP.AppAuth + Samuele E. Locatelli, EgalWare + false + MIT + Libreria accesso DB MP-Core x sync dati tabelle Config/Vocabolario + #releaseNotes# + #copyright# + MP.AppAuth DB + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/MP.Land.Release.nuspec b/MP.Land.Release.nuspec new file mode 100644 index 00000000..e6b6b05e --- /dev/null +++ b/MP.Land.Release.nuspec @@ -0,0 +1,27 @@ + + + + MP.AppAuth + #version# + MP.AppAuth + Samuele E. Locatelli, EgalWare + false + MIT + Libreria accesso DB MP-Core x sync dati tabelle Config/Vocabolario + #releaseNotes# + #copyright# + MP.AppAuth DB + + + + + + + + + + + + + + \ No newline at end of file