Ready to test yml
This commit is contained in:
parent
68ca8a269f
commit
559ea58c11
105
Fab2ApprovalSystem-Development.yml
Normal file
105
Fab2ApprovalSystem-Development.yml
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
trigger:
|
||||||
|
branches:
|
||||||
|
include:
|
||||||
|
- Development
|
||||||
|
paths:
|
||||||
|
include:
|
||||||
|
- "Fab2ApprovalSystem/*"
|
||||||
|
exclude:
|
||||||
|
- "**/*.yaml"
|
||||||
|
- "**/*.yml"
|
||||||
|
- "SQL/*"
|
||||||
|
- "references/*"
|
||||||
|
- "packages/*"
|
||||||
|
- "Kendo/*"
|
||||||
|
|
||||||
|
pool:
|
||||||
|
name: Mesa-IIS
|
||||||
|
demands: Fab2ApprovalSystem-Development
|
||||||
|
|
||||||
|
variables:
|
||||||
|
# solution: '**/*.sln'
|
||||||
|
# buildPlatform: 'Any CPU'
|
||||||
|
buildConfiguration: "Debug"
|
||||||
|
ASPNETCORE_ENVIRONMENT: "Development"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- script: |
|
||||||
|
set assemblyTitle=Fab2ApprovalSystem
|
||||||
|
echo %assemblyTitle%
|
||||||
|
echo ##vso[task.setvariable variable=AssemblyTitle;]%assemblyTitle%
|
||||||
|
echo $(AssemblyTitle)
|
||||||
|
displayName: AssemblyTitle
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set targetFrameworkVersion=v4.8
|
||||||
|
echo %targetFrameworkVersion%
|
||||||
|
echo ##vso[task.setvariable variable=TargetFrameworkVersion;]%targetFrameworkVersion%
|
||||||
|
echo $(TargetFrameworkVersion)
|
||||||
|
displayName: TargetFrameworkVersion
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set coreVersion=na
|
||||||
|
echo %coreVersion%
|
||||||
|
echo ##vso[task.setvariable variable=CoreVersion;]%coreVersion%
|
||||||
|
echo $(CoreVersion)
|
||||||
|
displayName: CoreVersion
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set configuration=Debug
|
||||||
|
echo %configuration%
|
||||||
|
echo ##vso[task.setvariable variable=Configuration;]%configuration%
|
||||||
|
echo ($Configuration)
|
||||||
|
displayName: Configuration
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
REM set nugetSource=https://messa017.infineon.com/v3/index.json
|
||||||
|
set nugetSource=https://eaf-prod.mes.infineon.com/v3/index.json
|
||||||
|
echo %nugetSource%
|
||||||
|
echo ##vso[task.setvariable variable=NugetSource;]%nugetSource%
|
||||||
|
echo $(NugetSource)
|
||||||
|
displayName: NugetSource
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set gitCommit=$(Build.SourceVersion)
|
||||||
|
set gitCommitSeven=%gitCommit:~0,7%
|
||||||
|
echo %gitCommitSeven%
|
||||||
|
echo ##vso[task.setvariable variable=GitCommitSeven;]%gitCommitSeven%
|
||||||
|
echo $(GitCommitSeven)
|
||||||
|
displayName: GitCommitSeven
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
echo $(AssemblyTitle)
|
||||||
|
echo $(Build.BuildId)
|
||||||
|
echo $(Build.Reason)
|
||||||
|
echo $(Build.Repository.Id)
|
||||||
|
echo $(Build.Repository.Name)
|
||||||
|
echo $(Build.SourceVersion)
|
||||||
|
echo $(CoreVersion)
|
||||||
|
echo $(Configuration)
|
||||||
|
echo $(NugetSource)
|
||||||
|
echo $(GitCommitSeven)
|
||||||
|
echo $(TargetFrameworkVersion)
|
||||||
|
REM echo $(pipelinePassword)
|
||||||
|
displayName: "Echo Check"
|
||||||
|
|
||||||
|
- script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Restore /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(Configuration);TargetFrameworkVersion=$(TargetFrameworkVersion) /p:RestoreSources=$(NugetSource) $(AssemblyTitle).csproj'
|
||||||
|
workingDirectory: Fab2ApprovalSystem
|
||||||
|
displayName: "Framework Restore"
|
||||||
|
|
||||||
|
- script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Build /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(Configuration);TargetFrameworkVersion=$(TargetFrameworkVersion) $(AssemblyTitle).csproj'
|
||||||
|
workingDirectory: Fab2ApprovalSystem
|
||||||
|
displayName: "Framework Build"
|
||||||
|
|
||||||
|
- script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(Configuration);TargetFrameworkVersion=$(TargetFrameworkVersion) /p:DebugSymbols=false /p:DeleteExistingFiles=true /p:DeployOnBuild=true /p:EnableUpdateAble=true /p:ExcludeApp_Data=true /p:LastUsedBuildConfiguration=$(Configuration) /p:LastUsedPlatform="Any CPU" /p:LaunchSiteAfterPublish=true /p:OutputPath="D:\$(TargetFrameworkVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)" /p:PreCompileBeforePublish=true /p:PublishProvider=FileSystem /p:PublishUrl="D:/PublishUrl" /p:SiteUrlToLaunchAfterPublish="" /p:WDPMergeOption=DoNotMerge /p:WebPublishMethod=FileSystem $(AssemblyTitle).csproj'
|
||||||
|
workingDirectory: Fab2ApprovalSystem
|
||||||
|
displayName: "Framework Pack"
|
||||||
|
|
||||||
|
- script: '"C:/Program Files (x86)/IIS/Microsoft Web Deploy V3/MSDeploy.exe" -AllowUntrusted -dest:auto -disableLink:AppPoolExtension -disableLink:CertificateExtension -disableLink:ContentExtension -setParam:name="IIS Web Application Name",value=$(Build.Repository.Name) -setParamFile:"D:\$(TargetFrameworkVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)" "/_PublishedWebsites/$(Build.Repository.Name)_Package/$(Build.Repository.Name).SetParameters.xml" -source:package="D:\$(TargetFrameworkVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)" "/_PublishedWebsites/$(AssemblyTitle)_Package/$(AssemblyTitle).zip" -verb:sync'
|
||||||
|
workingDirectory: Fab2ApprovalSystem
|
||||||
|
displayName: "Framework Deploy"
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
- script: 'echo $(Build.SourceVersion)-$(Build.BuildId)>bin_x_x_\$(Configuration)\$(CoreVersion)\win-x64\$(Build.Repository.Name).txt'
|
||||||
|
displayName: "Force Fail"
|
||||||
|
enabled: false
|
105
Fab2ApprovalSystem.yml
Normal file
105
Fab2ApprovalSystem.yml
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
trigger:
|
||||||
|
branches:
|
||||||
|
include:
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
include:
|
||||||
|
- "Fab2ApprovalSystem/*"
|
||||||
|
exclude:
|
||||||
|
- "**/*.yaml"
|
||||||
|
- "**/*.yml"
|
||||||
|
- "SQL/*"
|
||||||
|
- "references/*"
|
||||||
|
- "packages/*"
|
||||||
|
- "Kendo/*"
|
||||||
|
|
||||||
|
pool:
|
||||||
|
name: Mesa-IIS
|
||||||
|
demands: Fab2ApprovalSystem
|
||||||
|
|
||||||
|
variables:
|
||||||
|
# solution: '**/*.sln'
|
||||||
|
# buildPlatform: 'Any CPU'
|
||||||
|
buildConfiguration: "Release"
|
||||||
|
ASPNETCORE_ENVIRONMENT: "Production"
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- script: |
|
||||||
|
set assemblyTitle=Fab2ApprovalSystem
|
||||||
|
echo %assemblyTitle%
|
||||||
|
echo ##vso[task.setvariable variable=AssemblyTitle;]%assemblyTitle%
|
||||||
|
echo $(AssemblyTitle)
|
||||||
|
displayName: AssemblyTitle
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set targetFrameworkVersion=v4.8
|
||||||
|
echo %targetFrameworkVersion%
|
||||||
|
echo ##vso[task.setvariable variable=TargetFrameworkVersion;]%targetFrameworkVersion%
|
||||||
|
echo $(TargetFrameworkVersion)
|
||||||
|
displayName: TargetFrameworkVersion
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set coreVersion=na
|
||||||
|
echo %coreVersion%
|
||||||
|
echo ##vso[task.setvariable variable=CoreVersion;]%coreVersion%
|
||||||
|
echo $(CoreVersion)
|
||||||
|
displayName: CoreVersion
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set configuration=Release
|
||||||
|
echo %configuration%
|
||||||
|
echo ##vso[task.setvariable variable=Configuration;]%configuration%
|
||||||
|
echo ($Configuration)
|
||||||
|
displayName: Configuration
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set nugetSource=https://eaf-prod.mes.infineon.com/v3/index.json
|
||||||
|
echo %nugetSource%
|
||||||
|
echo ##vso[task.setvariable variable=NugetSource;]%nugetSource%
|
||||||
|
echo $(NugetSource)
|
||||||
|
displayName: NugetSource
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
set gitCommit=$(Build.SourceVersion)
|
||||||
|
set gitCommitSeven=%gitCommit:~0,7%
|
||||||
|
echo %gitCommitSeven%
|
||||||
|
echo ##vso[task.setvariable variable=GitCommitSeven;]%gitCommitSeven%
|
||||||
|
echo $(GitCommitSeven)
|
||||||
|
displayName: GitCommitSeven
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
echo $(AssemblyTitle)
|
||||||
|
echo $(Build.BuildId)
|
||||||
|
echo $(Build.Reason)
|
||||||
|
echo $(Build.Repository.Id)
|
||||||
|
echo $(Build.Repository.Name)
|
||||||
|
echo $(Build.SourceVersion)
|
||||||
|
echo $(CoreVersion)
|
||||||
|
echo $(Configuration)
|
||||||
|
echo $(NugetSource)
|
||||||
|
echo $(GitCommitSeven)
|
||||||
|
echo $(TargetFrameworkVersion)
|
||||||
|
REM echo $(pipelinePassword)
|
||||||
|
displayName: "Echo Check"
|
||||||
|
|
||||||
|
- script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Restore /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(Configuration);TargetFrameworkVersion=$(TargetFrameworkVersion) /p:RestoreSources=$(NugetSource) $(AssemblyTitle).csproj'
|
||||||
|
workingDirectory: Fab2ApprovalSystem
|
||||||
|
displayName: "Framework Restore"
|
||||||
|
|
||||||
|
- script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /target:Build /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(Configuration);TargetFrameworkVersion=$(TargetFrameworkVersion) $(AssemblyTitle).csproj'
|
||||||
|
workingDirectory: Fab2ApprovalSystem
|
||||||
|
displayName: "Framework Build"
|
||||||
|
|
||||||
|
- script: '"C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe" /DetailedSummary /ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; /p:Configuration=$(Configuration);TargetFrameworkVersion=$(TargetFrameworkVersion) /p:DebugSymbols=false /p:DeleteExistingFiles=true /p:DeployOnBuild=true /p:EnableUpdateAble=true /p:ExcludeApp_Data=true /p:LastUsedBuildConfiguration=$(Configuration) /p:LastUsedPlatform="Any CPU" /p:LaunchSiteAfterPublish=true /p:OutputPath="D:\$(TargetFrameworkVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)" /p:PreCompileBeforePublish=true /p:PublishProvider=FileSystem /p:PublishUrl="D:/PublishUrl" /p:SiteUrlToLaunchAfterPublish="" /p:WDPMergeOption=DoNotMerge /p:WebPublishMethod=FileSystem $(AssemblyTitle).csproj'
|
||||||
|
workingDirectory: Fab2ApprovalSystem
|
||||||
|
displayName: "Framework Pack"
|
||||||
|
|
||||||
|
- script: '"C:/Program Files (x86)/IIS/Microsoft Web Deploy V3/MSDeploy.exe" -AllowUntrusted -dest:auto -disableLink:AppPoolExtension -disableLink:CertificateExtension -disableLink:ContentExtension -setParam:name="IIS Web Application Name",value=$(Build.Repository.Name) -setParamFile:"D:\$(TargetFrameworkVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)" "/_PublishedWebsites/$(Build.Repository.Name)_Package/$(Build.Repository.Name).SetParameters.xml" -source:package="D:\$(TargetFrameworkVersion)\$(Build.Repository.Name)\$(GitCommitSeven)-$(Build.BuildId)-$(Build.Repository.Name)-$(Configuration)" "/_PublishedWebsites/$(AssemblyTitle)_Package/$(AssemblyTitle).zip" -verb:sync'
|
||||||
|
workingDirectory: Fab2ApprovalSystem
|
||||||
|
displayName: "Framework Deploy"
|
||||||
|
enabled: false
|
||||||
|
|
||||||
|
- script: 'echo $(Build.SourceVersion)-$(Build.BuildId)>bin_x_x_\$(Configuration)\$(CoreVersion)\win-x64\$(Build.Repository.Name).txt'
|
||||||
|
displayName: "Force Fail"
|
||||||
|
enabled: false
|
||||||
|
|
@ -1,164 +0,0 @@
|
|||||||
#!/usr/bin/env groovy
|
|
||||||
/* groovylint-disable CompileStatic, ConsecutiveStringConcatenation, DuplicateNumberLiteral, DuplicateStringLiteral, LineLength, NestedBlockDepth, NoDef, VariableTypeRequired */
|
|
||||||
import groovy.transform.Field
|
|
||||||
|
|
||||||
@Field String _DDrive = 'D:/'
|
|
||||||
@Field String _AssemblyName = '...'
|
|
||||||
@Field String _GitCommitSeven = '...'
|
|
||||||
@Field String _NetVersion = 'Framework4.8'
|
|
||||||
@Field String _GitName = 'Fab-2-Approval-System'
|
|
||||||
@Field String _AgentProduction = 'messa08ec-ecmeseaf'
|
|
||||||
@Field String _DDriveNet = "${_DDrive}${_NetVersion}"
|
|
||||||
@Field String _AgentStaging = 'messa016ec-ecouellette'
|
|
||||||
@Field String _AgentDevelopment = 'mestsa003-meseafsvc'
|
|
||||||
@Field String _ProgramFilesMSDeploy = 'C:/Program Files (x86)/IIS/Microsoft Web Deploy V3/MSDeploy.exe'
|
|
||||||
@Field String _ProgramFilesMSBuild = 'C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe'
|
|
||||||
|
|
||||||
pipeline {
|
|
||||||
agent {
|
|
||||||
label env.JENKINS_ENVIRONMENT == 'Development' ? _AgentDevelopment : env.JENKINS_ENVIRONMENT == 'Staging' ? _AgentStaging : env.JENKINS_ENVIRONMENT == 'Production' ? _AgentProduction : 'Else'
|
|
||||||
}
|
|
||||||
parameters {
|
|
||||||
string(name: 'GIT_SERVER', defaultValue: env.JENKINS_ENVIRONMENT == 'Development' ? 'mestsa003.infineon.com' : 'mestsa07ec.ec.local', description: 'git server')
|
|
||||||
string(name: 'DEFAULT_FILE_SERVER', defaultValue: env.JENKINS_ENVIRONMENT == 'Development' ? 'messv02ecc1_ec_local' : 'messv02ecc1.ec.local', description: 'Default file server...')
|
|
||||||
}
|
|
||||||
stages {
|
|
||||||
stage('Git') {
|
|
||||||
steps {
|
|
||||||
bat(returnStatus: true, script: 'git init')
|
|
||||||
bat(returnStatus: true, script: 'git remote add origin \\\\' + params.GIT_SERVER + '\\Git\\' + _GitName + '.git')
|
|
||||||
bat(returnStatus: true, script: 'git pull origin master')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Setup') {
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
_AssemblyName = "${env.JOB_NAME}"
|
|
||||||
_GitCommitSeven = '1234567'
|
|
||||||
// _GitCommitSeven = env.GIT_COMMIT.substring(0, 7)
|
|
||||||
def files = findFiles(glob: '*.csproj')
|
|
||||||
if (files.length != 1) {
|
|
||||||
error("Build failed because couldn't find a *.csproj file")
|
|
||||||
}
|
|
||||||
echo """
|
|
||||||
${files[0].name}
|
|
||||||
${files[0].path}
|
|
||||||
${files[0].directory}
|
|
||||||
${files[0].length}
|
|
||||||
${files[0].lastModified}
|
|
||||||
"""
|
|
||||||
_AssemblyName = files[0].name.split('[.]csproj')[0]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Info') {
|
|
||||||
steps {
|
|
||||||
echo "_AssemblyName ${_AssemblyName}" // ...
|
|
||||||
echo "BUILD_NUMBER ${env.BUILD_NUMBER}" // 11
|
|
||||||
echo "DEFAULT_FILE_SERVER ${params.DEFAULT_FILE_SERVER}" // 11
|
|
||||||
echo "GIT_BRANCH ${env.GIT_BRANCH}" // origin/master
|
|
||||||
echo "GIT_COMMIT ${env.GIT_COMMIT}" // 73b814069f2cf0173a62a8228815a9bc9ba93c41
|
|
||||||
echo "GIT_SERVER ${params.GIT_SERVER}" // ...
|
|
||||||
echo "GIT_URL ${env.GIT_URL}" // D:\ProgramData\Git\....git
|
|
||||||
echo "JENKINS_ENVIRONMENT ${env.JENKINS_ENVIRONMENT}" // 11
|
|
||||||
echo "JENKINS_URL ${env.JENKINS_URL}" // http://localhost:8080/
|
|
||||||
echo "JOB_NAME ${env.JOB_NAME}" // ...
|
|
||||||
echo "WORKSPACE ${env.WORKSPACE}" // D:\.jenkins\_\...
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Framework Build') {
|
|
||||||
steps {
|
|
||||||
echo "Build number is ${currentBuild.number}"
|
|
||||||
bat(returnStatus: true, script: '"' + _ProgramFilesMSBuild + '" ' +
|
|
||||||
'/target:Restore ' +
|
|
||||||
'/DetailedSummary ' +
|
|
||||||
'/ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; ' +
|
|
||||||
'/p:Configuration=Debug;TargetFrameworkVersion=v4.8 ' +
|
|
||||||
_AssemblyName + '.csproj')
|
|
||||||
bat(returnStatus: true, script: '"' + _ProgramFilesMSBuild + '" ' +
|
|
||||||
'/target:Build ' +
|
|
||||||
'/DetailedSummary ' +
|
|
||||||
'/ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; ' +
|
|
||||||
'/p:Configuration=Debug;TargetFrameworkVersion=v4.8 ' +
|
|
||||||
_AssemblyName + '.csproj')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// stage('Commit Id') {
|
|
||||||
// steps {
|
|
||||||
// dir('bin/Debug') {
|
|
||||||
// writeFile file: "${_AssemblyName}.txt", text: "${env.GIT_COMMIT}-${env.BUILD_NUMBER}-${env.GIT_URL}"
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// stage('Package') {
|
|
||||||
// steps {
|
|
||||||
// fileOperations([fileZipOperation(folderPath: 'bin/Debug', outputFolderPath: "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${env.JOB_NAME}-Debug")])
|
|
||||||
// fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*", renameFiles: false, sourceCaptureExpression: '', targetLocation: "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${env.JOB_NAME}-Debug", targetNameExpression: '')])
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
stage('Framework Package') {
|
|
||||||
steps {
|
|
||||||
bat(returnStatus: true, script: '"' + _ProgramFilesMSBuild + '" ' +
|
|
||||||
'/DetailedSummary ' +
|
|
||||||
'/ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; ' +
|
|
||||||
'/p:Configuration=Debug;TargetFrameworkVersion=v4.8 ' +
|
|
||||||
'/p:DebugSymbols=false ' +
|
|
||||||
'/p:DeleteExistingFiles=true ' +
|
|
||||||
'/p:DeployOnBuild=true ' +
|
|
||||||
'/p:EnableUpdateAble=true ' +
|
|
||||||
'/p:ExcludeApp_Data=true ' +
|
|
||||||
'/p:LastUsedBuildConfiguration=Release ' +
|
|
||||||
'/p:LastUsedPlatform="Any CPU" ' +
|
|
||||||
'/p:LaunchSiteAfterPublish=true ' +
|
|
||||||
'/p:OutputPath="' + "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${env.JOB_NAME}" + '" ' +
|
|
||||||
'/p:PreCompileBeforePublish=true ' +
|
|
||||||
'/p:PublishProvider=FileSystem ' +
|
|
||||||
'/p:PublishUrl="D:/PublishUrl" ' +
|
|
||||||
'/p:SiteUrlToLaunchAfterPublish="" ' +
|
|
||||||
'/p:WDPMergeOption=DoNotMerge ' +
|
|
||||||
'/p:WebPublishMethod=FileSystem ' +
|
|
||||||
_AssemblyName + '.csproj')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('MS-Deploy') {
|
|
||||||
steps {
|
|
||||||
bat(returnStatus: true, script: '"' + _ProgramFilesMSDeploy + '" ' +
|
|
||||||
'-AllowUntrusted ' +
|
|
||||||
'-dest:auto ' +
|
|
||||||
'-disableLink:AppPoolExtension ' +
|
|
||||||
'-disableLink:CertificateExtension ' +
|
|
||||||
'-disableLink:ContentExtension ' +
|
|
||||||
'-setParam:name="IIS Web Application Name",value=' + _AssemblyName + ' ' +
|
|
||||||
'-setParamFile:"' + "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${env.JOB_NAME}" + '/_PublishedWebsites/' + _AssemblyName + '_Package/' + _AssemblyName + '.SetParameters.xml" ' +
|
|
||||||
'-source:package="' + "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${env.JOB_NAME}" + '/_PublishedWebsites/' + _AssemblyName + '_Package/' + _AssemblyName + '.zip" ' +
|
|
||||||
'-verb:sync')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// stage('Force Fail') {
|
|
||||||
// steps {
|
|
||||||
// error("Build failed because of this and that..")
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// stage('Copy Files to: file-share') {
|
|
||||||
// steps {
|
|
||||||
// dir('bin/Debug') {
|
|
||||||
// fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.txt", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')])
|
|
||||||
// fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.dll", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')])
|
|
||||||
// fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.exe", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')])
|
|
||||||
// fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.pdb", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')])
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
post {
|
|
||||||
always {
|
|
||||||
dir('bin') {
|
|
||||||
deleteDir()
|
|
||||||
}
|
|
||||||
dir('obj') {
|
|
||||||
deleteDir()
|
|
||||||
}
|
|
||||||
// cleanWs()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1968,7 +1968,7 @@
|
|||||||
<Version>1.2.0</Version>
|
<Version>1.2.0</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="SharpZipLib">
|
<PackageReference Include="SharpZipLib">
|
||||||
<Version>0.86.0</Version>
|
<Version>1.4.2</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
<PackageReference Include="System.Linq">
|
<PackageReference Include="System.Linq">
|
||||||
<Version>4.3.0</Version>
|
<Version>4.3.0</Version>
|
||||||
|
175
Fab2ApprovalSystem/Jenkinsfile
vendored
175
Fab2ApprovalSystem/Jenkinsfile
vendored
@ -1,175 +0,0 @@
|
|||||||
#!/usr/bin/env groovy
|
|
||||||
/* groovylint-disable CompileStatic, ConsecutiveStringConcatenation, DuplicateNumberLiteral, DuplicateStringLiteral, LineLength, NestedBlockDepth, NoDef, VariableTypeRequired */
|
|
||||||
import groovy.transform.Field
|
|
||||||
|
|
||||||
@Field String _DDrive = 'D:/'
|
|
||||||
@Field String _AssemblyName = '...'
|
|
||||||
@Field String _GitCommitSeven = '...'
|
|
||||||
@Field String _NetVersion = 'Framework4.8'
|
|
||||||
@Field String _GitName = 'Fab-2-Approval-System'
|
|
||||||
@Field String _AgentProduction = 'messa08ec-ecmeseaf'
|
|
||||||
@Field String _DDriveNet = "${_DDrive}${_NetVersion}"
|
|
||||||
@Field String _AgentStaging = 'messa016ec-ecouellette'
|
|
||||||
@Field String _AgentDevelopment = 'mestsa003-meseafsvc'
|
|
||||||
@Field String _ProgramFilesMSDeploy = 'C:/Program Files (x86)/IIS/Microsoft Web Deploy V3/MSDeploy.exe'
|
|
||||||
@Field String _ProgramFilesMSBuild = 'C:/Program Files (x86)/Microsoft Visual Studio/2022/BuildTools/MSBuild/Current/Bin/MSBuild.exe'
|
|
||||||
|
|
||||||
pipeline {
|
|
||||||
agent {
|
|
||||||
label env.JENKINS_ENVIRONMENT == 'Development' ? _AgentDevelopment : env.JENKINS_ENVIRONMENT == 'Staging' ? _AgentStaging : env.JENKINS_ENVIRONMENT == 'Production' ? _AgentProduction : 'Else'
|
|
||||||
}
|
|
||||||
parameters {
|
|
||||||
string(name: 'GIT_SERVER', defaultValue: env.JENKINS_ENVIRONMENT == 'Development' ? 'mestsa003.infineon.com' : 'mestsa07ec.ec.local', description: 'git server')
|
|
||||||
string(name: 'DEFAULT_FILE_SERVER', defaultValue: env.JENKINS_ENVIRONMENT == 'Development' ? 'messv02ecc1_ec_local' : 'messv02ecc1.ec.local', description: 'Default file server...')
|
|
||||||
}
|
|
||||||
stages {
|
|
||||||
// stage('Git') {
|
|
||||||
// steps {
|
|
||||||
// bat(returnStatus: true, script: 'git init')
|
|
||||||
// bat(returnStatus: true, script: 'git remote add origin \\\\' + params.GIT_SERVER + '\\Git\\' + _GitName + '.git')
|
|
||||||
// bat(returnStatus: true, script: 'git pull origin master')
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
stage('Setup') {
|
|
||||||
steps {
|
|
||||||
script {
|
|
||||||
_AssemblyName = "${env.JOB_NAME}"
|
|
||||||
// _GitCommitSeven = '1234567'
|
|
||||||
_GitCommitSeven = env.GIT_COMMIT.substring(0, 7)
|
|
||||||
def files = findFiles(glob: '*.csproj')
|
|
||||||
if (files.length != 1) {
|
|
||||||
error("Build failed because couldn't find a *.csproj file")
|
|
||||||
}
|
|
||||||
echo """
|
|
||||||
${files[0].name}
|
|
||||||
${files[0].path}
|
|
||||||
${files[0].directory}
|
|
||||||
${files[0].length}
|
|
||||||
${files[0].lastModified}
|
|
||||||
"""
|
|
||||||
_AssemblyName = files[0].name.split('[.]csproj')[0]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Info') {
|
|
||||||
steps {
|
|
||||||
echo "_AssemblyName ${_AssemblyName}" // ...
|
|
||||||
echo "BUILD_NUMBER ${env.BUILD_NUMBER}" // 11
|
|
||||||
echo "DEFAULT_FILE_SERVER ${params.DEFAULT_FILE_SERVER}" // 11
|
|
||||||
echo "GIT_BRANCH ${env.GIT_BRANCH}" // origin/master
|
|
||||||
echo "GIT_COMMIT ${env.GIT_COMMIT}" // 73b814069f2cf0173a62a8228815a9bc9ba93c41
|
|
||||||
echo "GIT_SERVER ${params.GIT_SERVER}" // ...
|
|
||||||
echo "GIT_URL ${env.GIT_URL}" // D:\ProgramData\Git\....git
|
|
||||||
echo "JENKINS_ENVIRONMENT ${env.JENKINS_ENVIRONMENT}" // 11
|
|
||||||
echo "JENKINS_URL ${env.JENKINS_URL}" // http://localhost:8080/
|
|
||||||
echo "JOB_NAME ${env.JOB_NAME}" // ...
|
|
||||||
echo "WORKSPACE ${env.WORKSPACE}" // D:\.jenkins\_\...
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Framework Build') {
|
|
||||||
steps {
|
|
||||||
echo "Build number is ${currentBuild.number}"
|
|
||||||
bat(returnStatus: true, script: '"' + _ProgramFilesMSBuild + '" ' +
|
|
||||||
'/target:Restore ' +
|
|
||||||
'/DetailedSummary ' +
|
|
||||||
'/ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; ' +
|
|
||||||
'/p:Configuration=Debug;TargetFrameworkVersion=v4.8 ' +
|
|
||||||
_AssemblyName + '.csproj')
|
|
||||||
bat(returnStatus: true, script: '"' + _ProgramFilesMSBuild + '" ' +
|
|
||||||
'/target:Build ' +
|
|
||||||
'/DetailedSummary ' +
|
|
||||||
'/ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; ' +
|
|
||||||
'/p:Configuration=Debug;TargetFrameworkVersion=v4.8 ' +
|
|
||||||
_AssemblyName + '.csproj')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// stage('Commit Id') {
|
|
||||||
// steps {
|
|
||||||
// dir('bin/Debug') {
|
|
||||||
// writeFile file: "${_AssemblyName}.txt", text: "${env.GIT_COMMIT}-${env.BUILD_NUMBER}-${env.GIT_URL}"
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// stage('Package') {
|
|
||||||
// steps {
|
|
||||||
// fileOperations([fileZipOperation(folderPath: 'bin/Debug', outputFolderPath: "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${env.JOB_NAME}-Debug")])
|
|
||||||
// fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*", renameFiles: false, sourceCaptureExpression: '', targetLocation: "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${env.JOB_NAME}-Debug", targetNameExpression: '')])
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
stage('Framework Publish') {
|
|
||||||
steps {
|
|
||||||
echo "Build number is ${currentBuild.number}"
|
|
||||||
bat(returnStatus: true, script: '"' + _ProgramFilesMSBuild + '" ' +
|
|
||||||
'/p:DeployOnBuild=true ' +
|
|
||||||
'/detailedsummary ' +
|
|
||||||
'/property:Configuration=Debug;TargetFrameworkVersion=v4.8 ' +
|
|
||||||
'/p:PublishProfile=Properties/PublishProfiles/MesaProdProfile.pubxml ' +
|
|
||||||
_AssemblyName + '.csproj')
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// stage('Framework Package') {
|
|
||||||
// steps {
|
|
||||||
// bat(returnStatus: true, script: '"' + _ProgramFilesMSBuild + '" ' +
|
|
||||||
// '/DetailedSummary ' +
|
|
||||||
// '/ConsoleLoggerParameters:PerformanceSummary;ErrorsOnly; ' +
|
|
||||||
// '/p:Configuration=Debug;TargetFrameworkVersion=v4.8 ' +
|
|
||||||
// '/p:DebugSymbols=false ' +
|
|
||||||
// '/p:DeleteExistingFiles=true ' +
|
|
||||||
// '/p:DeployOnBuild=true ' +
|
|
||||||
// '/p:EnableUpdateAble=true ' +
|
|
||||||
// '/p:ExcludeApp_Data=true ' +
|
|
||||||
// '/p:LastUsedBuildConfiguration=Release ' +
|
|
||||||
// '/p:LastUsedPlatform="Any CPU" ' +
|
|
||||||
// '/p:LaunchSiteAfterPublish=true ' +
|
|
||||||
// '/p:OutputPath="' + "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${env.JOB_NAME}" + '" ' +
|
|
||||||
// '/p:PreCompileBeforePublish=true ' +
|
|
||||||
// '/p:PublishProvider=FileSystem ' +
|
|
||||||
// '/p:PublishUrl="D:/PublishUrl" ' +
|
|
||||||
// '/p:SiteUrlToLaunchAfterPublish="" ' +
|
|
||||||
// '/p:WDPMergeOption=DoNotMerge ' +
|
|
||||||
// '/p:WebPublishMethod=FileSystem ' +
|
|
||||||
// _AssemblyName + '.csproj')
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// stage('MS-Deploy') {
|
|
||||||
// steps {
|
|
||||||
// bat(returnStatus: true, script: '"' + _ProgramFilesMSDeploy + '" ' +
|
|
||||||
// '-AllowUntrusted ' +
|
|
||||||
// '-dest:auto ' +
|
|
||||||
// '-disableLink:AppPoolExtension ' +
|
|
||||||
// '-disableLink:CertificateExtension ' +
|
|
||||||
// '-disableLink:ContentExtension ' +
|
|
||||||
// '-setParam:name="IIS Web Application Name",value=' + _AssemblyName + ' ' +
|
|
||||||
// '-setParamFile:"' + "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${env.JOB_NAME}" + '/_PublishedWebsites/' + _AssemblyName + '_Package/' + _AssemblyName + '.SetParameters.xml" ' +
|
|
||||||
// '-source:package="' + "${_DDriveNet}/${_GitCommitSeven}-${env.BUILD_NUMBER}-${env.JOB_NAME}" + '/_PublishedWebsites/' + _AssemblyName + '_Package/' + _AssemblyName + '.zip" ' +
|
|
||||||
// '-verb:sync')
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// stage('Force Fail') {
|
|
||||||
// steps {
|
|
||||||
// error("Build failed because of this and that..")
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// stage('Copy Files to: file-share') {
|
|
||||||
// steps {
|
|
||||||
// dir('bin/Debug') {
|
|
||||||
// fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.txt", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')])
|
|
||||||
// fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.dll", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')])
|
|
||||||
// fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.exe", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')])
|
|
||||||
// fileOperations([fileCopyOperation(excludes: '', flattenFiles: true, includes: "${_AssemblyName}*.pdb", renameFiles: false, sourceCaptureExpression: '', targetLocation: _TargetLocation, targetNameExpression: '')])
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
post {
|
|
||||||
always {
|
|
||||||
dir('bin') {
|
|
||||||
deleteDir()
|
|
||||||
}
|
|
||||||
dir('obj') {
|
|
||||||
deleteDir()
|
|
||||||
}
|
|
||||||
cleanWs()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
x
Reference in New Issue
Block a user