Versión 2.0.0.0, script de publish y ruta HANA configurable
- AssemblyVersion/FileVersion 2.0.0.0 (Version 2.0.0); Swagger toma la versión del ensamblado - publicar.ps1: genera el publish y dist/ITCA_API_SAP_WMS_v<version>.zip sin appsettings - Net.Data y Net.Business.Services aceptan -p:HanaDll=<ruta> para compilar fuera de Windows Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2b82744eb8
commit
1d4d7769e3
5 files changed
+32
-3
No files matched your search
@@ -20,3 +20,6 @@ publish/
|
|||||||
appsettings.json
|
appsettings.json
|
||||||
appsettings.*.json
|
appsettings.*.json
|
||||||
!appsettings.example.json
|
!appsettings.example.json
|
||||||
|
|
||||||
|
# Salida de publicar.sh
|
||||||
|
dist/
|
||||||
@@ -3,6 +3,9 @@
|
|||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
<AssemblyName>ITCA_API_SAP_WMS</AssemblyName>
|
<AssemblyName>ITCA_API_SAP_WMS</AssemblyName>
|
||||||
|
<Version>2.0.0</Version>
|
||||||
|
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||||
|
<FileVersion>2.0.0.0</FileVersion>
|
||||||
<UserSecretsId>24763424-3300-4c85-87e3-503f8fdebd14</UserSecretsId>
|
<UserSecretsId>24763424-3300-4c85-87e3-503f8fdebd14</UserSecretsId>
|
||||||
<!-- Antes solo estaba condicionado a Debug|AnyCPU - un "dotnet publish -c Release"
|
<!-- Antes solo estaba condicionado a Debug|AnyCPU - un "dotnet publish -c Release"
|
||||||
(lo normal para IIS) se quedaba sin este archivo, y Startup.cs revienta con
|
(lo normal para IIS) se quedaba sin este archivo, y Startup.cs revienta con
|
||||||
@@ -30,7 +33,8 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Sap.Data.Hana.Core.v2.1">
|
<Reference Include="Sap.Data.Hana.Core.v2.1">
|
||||||
<HintPath>..\..\..\..\..\..\..\..\Program Files\sap\hdbclient\dotnetcore\v2.1\Sap.Data.Hana.Core.v2.1.dll</HintPath>
|
<HintPath Condition="'$(HanaDll)' == ''">..\..\..\..\..\..\..\..\Program Files\sap\hdbclient\dotnetcore\v2.1\Sap.Data.Hana.Core.v2.1.dll</HintPath>
|
||||||
|
<HintPath Condition="'$(HanaDll)' != ''">$(HanaDll)</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ namespace Net.Business.Services
|
|||||||
options.SwaggerDoc("ApiSAPWMS", new Microsoft.OpenApi.Models.OpenApiInfo()
|
options.SwaggerDoc("ApiSAPWMS", new Microsoft.OpenApi.Models.OpenApiInfo()
|
||||||
{
|
{
|
||||||
Title = "API SAP - WMS",
|
Title = "API SAP - WMS",
|
||||||
Version = "1",
|
Version = Assembly.GetExecutingAssembly().GetName().Version.ToString(),
|
||||||
Description = "API Integración SAP / WMS",
|
Description = "API Integración SAP / WMS",
|
||||||
Contact = new Microsoft.OpenApi.Models.OpenApiContact()
|
Contact = new Microsoft.OpenApi.Models.OpenApiContact()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,8 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Sap.Data.Hana.Core.v2.1">
|
<Reference Include="Sap.Data.Hana.Core.v2.1">
|
||||||
<HintPath>..\..\..\..\..\..\..\..\Program Files\sap\hdbclient\dotnetcore\v2.1\Sap.Data.Hana.Core.v2.1.dll</HintPath>
|
<HintPath Condition="'$(HanaDll)' == ''">..\..\..\..\..\..\..\..\Program Files\sap\hdbclient\dotnetcore\v2.1\Sap.Data.Hana.Core.v2.1.dll</HintPath>
|
||||||
|
<HintPath Condition="'$(HanaDll)' != ''">$(HanaDll)</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
# Genera el publish para IIS y lo comprime como dist\ITCA_API_SAP_WMS_v<version>.zip
|
||||||
|
# La versión sale de <AssemblyVersion> en Net.Business.Services.csproj.
|
||||||
|
# El zip NO incluye appsettings.json ni appsettings.Development.json (no pisar los del servidor).
|
||||||
|
# Requiere Windows (el driver Sap.Data.Hana se referencia desde C:\Program Files\sap\hdbclient).
|
||||||
|
$ErrorActionPreference = 'Stop'
|
||||||
|
Set-Location $PSScriptRoot
|
||||||
|
|
||||||
|
$csproj = 'Net.Business.Services\Net.Business.Services.csproj'
|
||||||
|
$version = ([xml](Get-Content $csproj)).Project.PropertyGroup.AssemblyVersion | Where-Object { $_ } | Select-Object -First 1
|
||||||
|
if (-not $version) { throw "No se encontró AssemblyVersion en $csproj" }
|
||||||
|
|
||||||
|
$out = "dist\ITCA_API_SAP_WMS_v$version"
|
||||||
|
$zip = "dist\ITCA_API_SAP_WMS_v$version.zip"
|
||||||
|
Remove-Item $out, $zip -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
|
||||||
|
dotnet publish $csproj -c Release -r win-x64 --self-contained false -o $out
|
||||||
|
if ($LASTEXITCODE -ne 0) { throw 'dotnet publish falló' }
|
||||||
|
|
||||||
|
Remove-Item "$out\appsettings.json", "$out\appsettings.Development.json" -ErrorAction SilentlyContinue
|
||||||
|
Compress-Archive -Path "$out\*" -DestinationPath $zip
|
||||||
|
Write-Host "Generado: $zip"
|
||||||
Reference in new issue
Block a user