91 lines
3.8 KiB
YAML
91 lines
3.8 KiB
YAML
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.7.2 Tools'
|
||
EXE_RELEASE_FOLDER: 'c:\Projetcs\Compiled\GPW\Release'
|
||
DEPLOY_FOLDER: 'c:\Projects\Deploy\GPW\Builds'
|
||
VERS_MAIN: '4.1'
|
||
NEW_REL: ''
|
||
NEW_DEB: ''
|
||
NEXUS_PATH: 'MedAP'
|
||
PROJ_NAME: 'MedAP'
|
||
APP_NAME: 'MedAP'
|
||
APP_CONF: 'Release'
|
||
|
||
|
||
# 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 x fix version number
|
||
.version-fix: &version-fix
|
||
- |
|
||
$env:NEW_REL = $env:VERS_MAIN+"."+(get-date –format yyMM)+"."+(get-date –format ddHH)
|
||
echo "Set vers: $env:NEW_REL"
|
||
$contenuto = Get-Content -path 'VersGen\VersGen.cs' -Raw
|
||
$newContenuto = $contenuto -replace '000.000', $env:NEW_REL
|
||
$newContenuto | Set-Content -Path 'VersGen\VersGen.cs'
|
||
|
||
stages:
|
||
- build
|
||
- staging
|
||
- deploy
|
||
|
||
MedAP:build:
|
||
stage: build
|
||
tags:
|
||
- win
|
||
before_script:
|
||
- *nuget-fix
|
||
- '& "$env:NUGET_PATH" restore MedAP.sln -verbosity quiet'
|
||
- *version-fix
|
||
script:
|
||
- '& "$env:MSBUILD_PATH" MedAP/MedAP.csproj -target:Build /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath=bin/ /verbosity:minimal /m'
|
||
|
||
MedAP:staging:
|
||
stage: staging
|
||
tags:
|
||
- win
|
||
rules:
|
||
- if: '$CI_COMMIT_BRANCH == "develop"'
|
||
variables:
|
||
APP_NAME: MedAP_TK
|
||
PROJ_NAME: MedAP
|
||
NEXUS_PATH: MedAP
|
||
before_script:
|
||
- *nuget-fix
|
||
- '& "$env:NUGET_PATH" restore MedAP.sln -verbosity quiet'
|
||
- *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=Release /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal MedAP/MedAP.csproj'
|
||
# lasciato commentato in prod
|
||
# - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=DEMO-OVH.pubxml /p:RunCodeAnalysis=false /p:Configuration=DEMO-OVH /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal MedAP/MedAP.csproj'
|
||
needs: ["MedAP:build"]
|
||
|
||
MedAP:deploy:
|
||
stage: deploy
|
||
tags:
|
||
- win
|
||
rules:
|
||
- if: '$CI_COMMIT_BRANCH == "master"'
|
||
variables:
|
||
APP_NAME: MedAP
|
||
PROJ_NAME: MedAP
|
||
NEXUS_PATH: MedAP
|
||
before_script:
|
||
- *nuget-fix
|
||
- '& "$env:NUGET_PATH" restore MedAP.sln -verbosity quiet'
|
||
- *version-fix
|
||
script:
|
||
- '& "$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=Release /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal MedAP/MedAP.csproj'
|
||
# lasciato commentato in prod
|
||
# - '& "$env:MSBUILD_PATH" /p:m=8 /p:AspnetMergePath=$env:ASPNET_MERGE_PATH /p:DeployOnBuild=true /p:Targets=Publish /p:PublishProfile=PROD-OVH.pubxml /p:RunCodeAnalysis=false /p:Configuration=PROD-OVH /p:username=jenkins /p:Password=viadante16 /p:AllowUntrustedCertificate=true /p:OutputPath=bin/ /verbosity:minimal MedAP/MedAP.csproj'
|
||
needs: ["MedAP:build"]
|
||
|