Gitlabからプルし、MSBuildを実行し、アーティファクトをディレクトリに公開し、すべてのアーティファクトを圧縮してリポジトリまたはファイル共有にプッシュするためのJenkinsパイプラインを構築しようとしています。アプリケーションはWebアプリケーションです。JenkinsパイプラインGroovy MSBuildアーティファクト
AntBuilderからzip関数を実装しようとすると、私の問題が発生します。私の基盤に何を指定しても、ディレクトリが見つからないということはできません。私のコードは以下の通りです。
#!groovy
node('dotnet') { //select any node with a doctnet label
stage('Checkout') { //checkout the code from source
checkout([$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [], gitTool: 'Windows_Gtt', submoduleCfg: [], userRemoteConfigs: [[credentialsId: '99999999-9999-9999-99999', url: '[email protected]:api/sharedservices.git']]])
}
stage('Build') { //build steps go here
bat 'nuget restore LandingPageSvc.sln' //restore nuget sources
bat "\"${tool 'MSBUILD46_64_Pipeline'}\" LandingPageSvc.sln /m /p:VisualStudioVersion=14.0" //msbuild
}
// stage('NUnit Tests') { //Unit testing steps go here
// bat '"C:\\Program Files (x86)\\NUnit.org\\nunit-console\\nunit3-console.exe" ./LandingPageSvc.Test/bin/Debug/LandingPageSvc.Tests.dll --result nunit-result.xml'
// }
stage('Packaging') {
bat "\"${tool 'MSBUILD46_64_Pipeline'}\" LandingPageSvc\\LandingPageSvc.csproj /m /p:VisualStudioVersion=14.0;Configuration=Debug;PublishDestination=..\\Publish\\Dev /t:PublishToFileSystem"
def ant = new AntBuilder()
ant.zip(destfile: "test.zip", basedir: "./Publish/Dev")
}
stage('Publish') {
// build nuget package
//push nuget pcakage to artifactory
}
}
ので、他のすべてはDOTNETのビルドエージェント上のワークスペースにうまく解決し、私もパスで${WORKSPACE}
を使用してみましたが、それはまだ文句を言います。
この特定の関数が実行されている理由やコンテキストはわかりませんが、ドットネットビルドエージェントやプロジェクトワークスペースには表示されません。
ご意見をお寄せください。