Update jenkinsfile x installer e SDK

This commit is contained in:
Samuele E. Locatelli
2020-01-14 09:25:23 +01:00
parent b9c455db31
commit 8ecd1f476b
Vendored
+57 -6
View File
@@ -17,9 +17,10 @@ pipeline {
/* calcolo numero versione... diverso x branch MASTER/DEVELOP */
script {
withEnv(['NEXT_BUILD_NUMBER=175']) {
withEnv(['NEXT_BUILD_NUMBER=176']) {
// env.versionNumber = VersionNumber(versionNumberString : '0.7.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true)
env.versionNumber = VersionNumber(versionNumberString : '0.7.${BUILD_DATE_FORMATTED, "yyMM"}.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
env.versionNumberBeta = VersionNumber(versionNumberString : '0.7.${BUILD_DATE_FORMATTED, "yyMM"}-beta.${BUILDS_ALL_TIME}', projectStartDate : '2019-07-01', skipFailedBuilds: true, overrideBuildsAllTime: '${NEXT_BUILD_NUMBER}')
env.APP_NAME = 'NKC'
}
}
@@ -135,18 +136,68 @@ pipeline {
}
// ora mi occupo delle operazioni di compressione e copia...
script {
/* compilo installers SOLO stable / beta */
/* compilo installers SOLO stable / beta */
if (env.BRANCH_NAME == "stable" || env.BRANCH_NAME.contains("beta") ) {
// calcolo il config...
if (env.BRANCH_NAME == "beta") {
env.config = "Debug"
env.classifier = "unstable"
}
else if (env.BRANCH_NAME == "stable") {
env.config = "Release"
env.classifier = ""
}
parallel (
SITE_NKC: {
sleep 0
// // SITE
// bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=Prod /p:PublishProfile=${env.BRANCH_NAME}.pubxml /p:VisualStudioVersion=15.0 /p:RunCodeAnalysis=false /p:PackageLocation=ReleaseClienti/${env.BRANCH_NAME}/SITE.zip /p:DeployIisAppPath=\"Default Web Site/MP/SITE\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ NKC_WF/NKC_WF.csproj"
// // pubblico su server deploy!
// publishToDeployServer("MP-SITE\\", "c:\\inetpub\\wwwroot\\SWS\\MAPO\\", "SITE")
// SITE
bat "\"${tool 'MSBuild-15.0'}\" \"/p:AspnetMergePath=C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v10.0A\\bin\\NETFX 4.6.2 Tools\" /T:Package /P:Configuration=Prod /p:PublishProfile=${env.BRANCH_NAME}.pubxml /p:VisualStudioVersion=15.0 /p:RunCodeAnalysis=false /p:PackageLocation=Releases/${env.BRANCH_NAME}/NKC.zip /p:DeployIisAppPath=\"Default Web Site/NKC\" /p:PackageAsSingleFile=True /p:OutputPath=bin/ NKC_WF/NKC_WF.csproj"
// pubblico su server deploy!
// publishToDeployServer("NKC\\", "c:\\inetpub\\wwwroot\\SWS\\", "NKC")
nexusArtifactUploader (
artifacts: [
[
artifactId: 'NKC',
classifier: "${env.classifier}",
file: "NKC\\Releases\\${env.BRANCH_NAME}\\NKC.zip",
type: 'zip'
]
],
credentialsId: 'bc9d8e92-4302-3266-817f-7b58501d12d5',
//groupId: 'MP',
nexusUrl: 'nexus.steamware.net',
nexusVersion: 'nexus3',
protocol: 'http',
repository: 'SWS',
version: "${env.versionNumber}"
)
},
failFast: false)
}
/* preparo nuget pkg SOLO SDK / beta */
else if (env.BRANCH_NAME == "SDK" || env.BRANCH_NAME.contains("beta") ) {
// calcolo il config...
if (env.BRANCH_NAME == "beta") {
env.config = "Debug"
env.packVers = env.versionNumberBeta
}
else if (env.BRANCH_NAME == "SDK") {
env.config = "Release"
env.packVers = env.versionNumber
}
// elimino vecchie build...
bat "del /f /q *.nupkg"
// BUILD!
bat "\"${tool 'MSBuild-16.0'}\" NKC_WF\\NKC_WF.csproj -target:Build /p:Configuration=${env.config} /p:Platform=\"Any CPU\" /p:OutputPath=bin/${env.config} /m"
// creo package NuGet... con version in modo da fare ANCHE le beta
bat "e:\\nuget.exe pack ${WORKSPACE}\\NKC_WF\\NKC_WF.csproj -properties Configuration=${env.config} -Version ${env.packVers}"
// lancio upload con nuget!
echo 'Start upload with nuget push'
bat "e:\\nuget setapikey fe387daa-d07c-3207-877e-96c8be1be91b -source http://nexus.steamware.net/repository/nuget-hosted"
bat "e:\\nuget.exe push MapoSDK.${env.packVers}.nupkg -Source http://nexus.steamware.net/repository/nuget-hosted"
}
else
{
echo 'Questo BRANCH non necessita di installer...'