Aggiunta preliminare CI/CD

This commit is contained in:
2023-07-24 16:31:57 +02:00
parent cd34987745
commit da26f57e75
4 changed files with 97 additions and 4 deletions
+87
View File
@@ -0,0 +1,87 @@
variables:
VERS_MAIN: '0.9'
NEW_REL: ''
APP_NAME: 'SMGen'
SOL_NAME: 'SMGen'
# helper x fix pacchetti nuget da repo locale nexus.steamware.net
.nuget-fix: &nuget-fix
- |
echo "esecuzione Nuget FIX steps"
dotnet nuget list source
$hasSource = dotnet nuget list source | Select-String -Pattern "Steamware Nexus Proxy"
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
dotnet nuget remove source "`"Steamware Nexus Proxy`""
}
$hasSource = dotnet nuget list source | Select-String -Pattern "Steamware Nexus"
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
dotnet nuget remove source "`"Steamware Nexus`""
}
$hasSource = dotnet nuget list source | Select-String -Pattern "nexus-proxy-v3"
if (! [String]::IsNullOrWhiteSpace($hasSource)) {
dotnet nuget remove source nexus-proxy-v3
}
dotnet nuget add source https://nexus.steamware.net/repository/nuget-group-3/index.json -n "Steamware Nexus" -u nugetUser -p $NEXUS_PASSWD --store-password-in-clear-text
echo "Steamware Nexus Source added"
stages:
- build
- staging
- deploy
# ---------- BUILD ----------
SMGen:build:
stage: build
tags:
- win
variables:
APP_NAME: SMGen
SOL_NAME: SMGen
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
# ---------- STAGING ----------
SMGen:staging:
stage: staging
tags:
- win
variables:
APP_NAME: SMGen
SOL_NAME: SMGen
only:
- develop
needs: ["SMGen:build"]
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
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
# ---------- DEPLOY ----------
SMGen:deploy:
stage: deploy
tags:
- win
environment:
name: production
url: https://office.egalware.com/MP/SMGEN
variables:
APP_NAME: SMGen
SOL_NAME: SMGen
only:
- main
needs: ["SMGen:build"]
before_script:
- *nuget-fix
- dotnet restore "$env:SOL_NAME.sln"
script:
- dotnet build $env:APP_NAME/$env:APP_NAME.csproj
# IIS PROD
- dotnet publish -p:PublishProfile=IIS-PROD.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
@@ -8,12 +8,11 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish>https://seriate.egalware.com/WDC/UI/</SiteUrlToLaunchAfterPublish>
<SiteUrlToLaunchAfterPublish>https://office.egalware.com/MP/SMGEN/</SiteUrlToLaunchAfterPublish>
<ExcludeApp_Data>false</ExcludeApp_Data>
<ProjectGuid>c2109e71-4eae-4167-9052-175123ccc2bc</ProjectGuid>
<SelfContained>false</SelfContained>
<MSDeployServiceURL>https://iis04.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>seriate.egalware.com/WDC/UI</DeployIisAppPath>
<DeployIisAppPath>office.egalware.com/MP/SMGEN</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>false</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
@@ -4,7 +4,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2023-05-22T13:35:59.9735292Z;False|2023-05-22T15:33:39.4808724+02:00;True|2023-05-11T17:36:48.1468628+02:00;</History>
<History>True|2023-07-24T14:24:14.2770302Z;True|2023-07-24T16:23:20.6455643+02:00;True|2023-05-22T15:35:59.9735292+02:00;False|2023-05-22T15:33:39.4808724+02:00;True|2023-05-11T17:36:48.1468628+02:00;</History>
<LastFailureDetails />
<TimeStampOfAssociatedLegacyPublishXmlFile />
<EncryptedPassword>AQAAANCMnd8BFdERjHoAwE/Cl+sBAAAAHBJL+AjnSkKKQcJBrmvYDwAAAAACAAAAAAADZgAAwAAAABAAAABqHjtCI4r9HP4to5TPRtU/AAAAAASAAACgAAAAEAAAAGWTrj6ykvtUZnIZTp5COsMYAAAAHkol9Zhdo3QCFNYyIvyJViyIyNSW1oNCFAAAAEvXT2wDdsDBGFpVXvR5NVA172tk</EncryptedPassword>
+7
View File
@@ -4,6 +4,8 @@
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<Description>State Machine Generator</Description>
<Version>0.8.2307.2416</Version>
</PropertyGroup>
<ItemGroup>
@@ -16,7 +18,12 @@
<ItemGroup>
<None Include="compilerconfig.json" />
<None Include="Properties\PublishProfiles\IIS-PROD.pubxml.user" />
<None Include="Properties\PublishProfiles\IIS01.pubxml.user" />
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell.exe -ExecutionPolicy Unrestricted -NoProfile -NonInteractive -File $(ProjectDir)\post-build.ps1 -ProjectDir $(ProjectDir) -ProjectPath $(ProjectPath)" />
</Target>
</Project>