Merge branch 'release/ConvertJenkinsToGitlabCiCd'

This commit is contained in:
Samuele Locatelli
2022-04-12 09:48:22 +02:00
10 changed files with 139 additions and 33 deletions
+38 -24
View File
@@ -25,19 +25,17 @@ variables:
.version-fix: &version-fix
- |
# Esecuzione fix numero versione x pack nuget
$fileNameAss = ".\$env:APP_NAME\Properties\AssemblyInfo.cs";
$find = "assembly: AssemblyVersion";
$riga = Select-String $fileNameAss -Pattern $find;
# recupero il valore della versione release/debug
$idxVers = $riga.ToString().IndexOf("AssemblyVersion(");
$currRelease = $riga.ToString().Substring($idxVers).Replace("AssemblyVersion(","").Replace(")]","").Replace("""","");
$fileName = "INTERFACE\VersGen\VersGen.cs";
# calcolo nuova
$env:NEW_REL = $env:VERS_MAIN+"."+(get-date format yyMM)+"."+(get-date format dHH)
echo "New vers: $env:NEW_REL"
# aggiorno file
$contenuto = Get-Content -path $fileNameAss -Raw
$newContenuto = $contenuto -replace $currRelease, $env:NEW_REL
$newContenuto | Set-Content -path $fileNameAss
$contenuto = Get-Content -path $fileName -Raw
$newContenuto = $contenuto -replace '0.0.0.0', $env:NEW_REL
$newContenuto | Set-Content -path $fileName
# helper x fix manifest xml
.manifest-fix: &manifest-fix
# helper creazione hash files
.hashBuild: &hashBuild
@@ -94,21 +92,37 @@ StockMan:build:
script:
- '& "$env:MSBUILD_PATH" $env:APP_NAME/$env:APP_NAME.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m'
# StockMan:IIS01:deploy:
# stage: deploy
# tags:
# - win
# except:
# refs:
# - main
# - master
# before_script:
# - *nuget-fix
# - '& "$env:NUGET_PATH" restore $env:APP_NAME.sln -Verbosity quiet'
# - *version-fix
# script:
# - '& "$env:MSBUILD_PATH" /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS01.pubxml /p:RunCodeAnalysis=false /p:Configuration=Release /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal $env:APP_NAME/$env:APP_NAME.csproj'
# needs: ["StockMan:build"]
StockMan:IIS01:deploy:
stage: deploy
tags:
- win
except:
refs:
- main
- master
before_script:
- *nuget-fix
- '& "$env:NUGET_PATH" restore $env:APP_NAME.sln -Verbosity quiet'
- *version-fix
script:
- '& "$env:MSBUILD_PATH" /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS01.pubxml /p:RunCodeAnalysis=false /p:Configuration=Release /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal $env:APP_NAME/$env:APP_NAME.csproj'
needs: ["StockMan:build"]
StockMan:IIS01_TK:deploy:
stage: deploy
tags:
- win
except:
refs:
- main
- master
before_script:
- *nuget-fix
- '& "$env:NUGET_PATH" restore $env:APP_NAME.sln -Verbosity quiet'
- *version-fix
script:
- '& "$env:MSBUILD_PATH" /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=IIS01_TK.pubxml /p:RunCodeAnalysis=false /p:Configuration=Release /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal $env:APP_NAME/$env:APP_NAME.csproj'
needs: ["StockMan:build"]
# StockMan:IIS02:deploy:
# stage: deploy
@@ -12,7 +12,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>True</ExcludeApp_Data>
<MSDeployServiceURL>https://IIS01:8172/MsDeploy.axd</MSDeployServiceURL>
<MSDeployServiceURL>https://IIS01.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/StockMan/STEA</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
@@ -12,7 +12,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>True</ExcludeApp_Data>
<MSDeployServiceURL>https://IIS01:8172/MsDeploy.axd</MSDeployServiceURL>
<MSDeployServiceURL>https://IIS01.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/StockMan/TK</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
@@ -12,7 +12,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>True</ExcludeApp_Data>
<MSDeployServiceURL>https://IIS02:8172/MsDeploy.axd</MSDeployServiceURL>
<MSDeployServiceURL>https://IIS02.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/StockMan/STEA</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
@@ -12,7 +12,7 @@ by editing this MSBuild file. In order to learn more about this please visit htt
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>True</ExcludeApp_Data>
<MSDeployServiceURL>https://IIS02:8172/MsDeploy.axd</MSDeployServiceURL>
<MSDeployServiceURL>https://IIS02.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/StockMan/TK</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<ADUsesOwinOrOpenIdConnect>False</ADUsesOwinOrOpenIdConnect>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>True</ExcludeApp_Data>
<MSDeployServiceURL>https://IIS03.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/StockMan/STEA</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>jenkins</UserName>
<_SavePWD>True</_SavePWD>
<VisualStudioVersion>14.0</VisualStudioVersion>
<AllowUntrustedCertificate>True</AllowUntrustedCertificate>
<PublishDatabaseSettings>
<Objects xmlns="">
<ObjectGroup Name="StockManEntities" Order="1" Enabled="False">
<Destination Path="Data Source=SQLSTEAM;Initial Catalog=StockMan;Persist Security Info=True;User ID=sa;Password=keyhammer" />
<Object Type="DbCodeFirst">
<Source Path="DBContext" DbContext="StockManMVC.Models.StockManEntities, StockManMVC" Origin="Configuration" />
</Object>
</ObjectGroup>
</Objects>
</PublishDatabaseSettings>
<PrecompileBeforePublish>True</PrecompileBeforePublish>
<EnableUpdateable>True</EnableUpdateable>
<DebugSymbols>False</DebugSymbols>
<WDPMergeOption>DonotMerge</WDPMergeOption>
<CodeAnalysisRuleSet></CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<MSDeployParameterValue Include="$(DeployParameterPrefix)StockManEntities-Web.config Connection String">
<ParameterValue>metadata=res://*/Models.SMModel.csdl|res://*/Models.SMModel.ssdl|res://*/Models.SMModel.msl;provider=System.Data.SqlClient;provider connection string="Data Source=SQLSTEAM;Initial Catalog=StockMan;Persist Security Info=True;User ID=sa;Password=keyhammer"</ParameterValue>
<UpdateDestWebConfig>False</UpdateDestWebConfig>
</MSDeployParameterValue>
</ItemGroup>
</Project>
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit http://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<ADUsesOwinOrOpenIdConnect>False</ADUsesOwinOrOpenIdConnect>
<LastUsedBuildConfiguration>IIS02_TK</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>True</ExcludeApp_Data>
<MSDeployServiceURL>https://IIS03.egalware.com:8172/MsDeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>Default Web Site/StockMan/TK</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>False</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>steamw\administrator</UserName>
<_SavePWD>True</_SavePWD>
<PublishDatabaseSettings>
<Objects xmlns="">
<ObjectGroup Name="StockManEntities" Order="1" Enabled="False">
<Destination Path="" />
<Object Type="DbCodeFirst">
<Source Path="DBContext" DbContext="StockManMVC.Models.StockManEntities, StockManMVC" Origin="Configuration" />
</Object>
</ObjectGroup>
</Objects>
</PublishDatabaseSettings>
<PrecompileBeforePublish>True</PrecompileBeforePublish>
<EnableUpdateable>True</EnableUpdateable>
<DebugSymbols>False</DebugSymbols>
<WDPMergeOption>DonotMerge</WDPMergeOption>
</PropertyGroup>
<ItemGroup>
<MSDeployParameterValue Include="$(DeployParameterPrefix)StockManEntities-Web.config Connection String">
<UpdateDestWebConfig>False</UpdateDestWebConfig>
</MSDeployParameterValue>
</ItemGroup>
</Project>
+2
View File
@@ -481,6 +481,8 @@
<Content Include="fonts\fontawesome-webfont.eot" />
<None Include="Properties\PublishProfiles\IIS01.pubxml" />
<None Include="Properties\PublishProfiles\IIS01_TK.pubxml" />
<None Include="Properties\PublishProfiles\IIS03_TK.pubxml" />
<None Include="Properties\PublishProfiles\IIS03.pubxml" />
<None Include="Properties\PublishProfiles\IIS02.pubxml" />
<None Include="Properties\PublishProfiles\IIS02_TK.pubxml" />
<None Include="Properties\PublishProfiles\TK_prod.pubxml" />
+3 -3
View File
@@ -5,7 +5,7 @@
using System.Reflection;
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyCopyright("Steamware © 2006-2019")]
[assembly: AssemblyVersion("0.0.0.0")]
[assembly: AssemblyFileVersion("0.0.0.0")]
[assembly: AssemblyCopyright("Steamware © 2006-2022")]
[assembly: AssemblyCompany("Steamware")]
+2 -2
View File
@@ -6,7 +6,7 @@
using System.Reflection;
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("0.0.0.0")]
[assembly: AssemblyFileVersion("0.0.0.0")]
[assembly: AssemblyCopyright("Steamware © 2006-<#= DateTime.Now.Year #>")]
[assembly: AssemblyCompany("Steamware")]