TeamCityとCakeを使用して新しいビルドサーバーをセットアップして、C#クラスライブラリとテストプロジェクトをビルドします。SonarQube、CakeとTeamCityの統合問題
私はSonarQubeをCakeビルドスクリプトに追加しようとしています。このためのCakeのプラグインはすでに存在しています(https://github.com/AgileArchitect/Cake.Sonar)、これはTeamCity BuildAgentの作業フォルダ内から手動でケーキビルドスクリプトを実行するときにはうまく動作しますが、TeamCityビルドステップとしてMSBuildとSonarQube壊れるようだ。
TC通過するとき、私は、ビルドログに取得するエラーは、次のとおりです。これらの
The SonarQube MSBuild integration failed: SonarQube was unable to collect the required information about your projects. Possible causes: 1. The project has not been built - the project must be built in between the begin and end steps 2. An unsupported version of MSBuild has been used to build the project. Currently MSBuild 12.0 upwards are supported 3. The begin, build or end steps have not all been launched from the same folder
どれも私には適用されません。ケーキのスクリプトは、両方の状況でbegin、build、およびendのステップを実行しています。私は現在のディレクトリをログアウトしています。それは両方のケースで期待通りですが、MSBuildのバージョンはまったく同じです。
ログでは、SonarBeginタスクはコマンドラインとTCの両方に対して同じようにログを記録します。
MSBuildがRunCodeAnalysisターゲットを設定し、/ rulesetのようなパラメータを追加するようなSonarからいくつかの設定を取得するように見えます。 csc.exeを呼び出すと、これはTCから実行しても起こりません。
何が起こっているのかを解決するためのアドバイスはありますか?
ValidateSolutionConfiguration: Building solution configuration "Release|Any CPU". The target "RunCodeAnalysis" listed in a BeforeTargets attribute at "C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\.sonarqube\bin\targets\SonarQube.Integration.targets (340,11)" does not exist in the project, and will be ignored. The target "RunCodeAnalysis" listed in an AfterTargets attribute at "C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\.sonarqube\bin\targets\SonarQube.Integration.targets (391,11)" does not exist in the project, and will be ignored. Project "C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\ContractManagement.Common.sln" (1) is building "C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\src\ContractManagement.Common\ContractManagement.Common.csproj" (2) on node 1 (default targets). GenerateTargetFrameworkMonikerAttribute: Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files. CreateProjectSpecificDirs: Directory "C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\.sonarqube\out\\ContractManagement.Common_AnyCPU_Release_5799" doesn't exist. Skipping. Creating directory "C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\.sonarqube\out\\ContractManagement.Common_AnyCPU_Release_5799". Directory "C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\.sonarqube\conf\\ContractManagement.Common_AnyCPU_Release_5799" doesn't exist. Skipping. Creating directory "C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\.sonarqube\conf\\ContractManagement.Common_AnyCPU_Release_5799". CoreCompile: C:\Program Files (x86)\MSBuild\14.0\bin\amd64\csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE /highentropyva+ /reference:C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\packages\Dapper.1.50.2\lib\net451\Dapper.dll /reference:C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\packages\Microsoft.ApplicationInsights.2.2.0\lib\net45\Microsoft.ApplicationInsights.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\Microsoft.CSharp.dll" /reference:C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\packages\morelinq.2.1.0\lib\net35\MoreLinq.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\mscorlib.dll" /reference:C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.Configuration.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.Xml.dll" /debug:pdbonly /filealign:512 /optimize+ /out:obj\Release\UdGroup.ContractManagement.Common.dll /ruleset:C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\.sonarqube\conf\SonarQubeRoslyn-cs.ruleset /errorlog:C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\src\ContractManagement.Common\bin\Release\UdGroup.ContractManagement.Common.dll.RoslynCA.json /subsystemversion:6.00 /target:library /warnaserror- /utf8output /analyzer:C:\Users\michael.tong\AppData\Local\Temp\.sonarqube\.static\csharp_1.22.0.1631\SonarAnalyzer-1.22.0.1631.zip\Google.Protobuf.dll /analyzer:C:\Users\michael.tong\AppData\Local\Temp\.sonarqube\.static\csharp_1.22.0.1631\SonarAnalyzer-1.22.0.1631.zip\SonarAnalyzer.CSharp.dll /analyzer:C:\Users\michael.tong\AppData\Local\Temp\.sonarqube\.static\csharp_1.22.0.1631\SonarAnalyzer-1.22.0.1631.zip\SonarAnalyzer.dll /additionalfile:C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\.sonarqube\conf\cs\SonarLint.xml /additionalfile:C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\.sonarqube\conf\\ContractManagement.Common_AnyCPU_Release_5799\ProjectOutFolderPath.txt Authentication\AuthDetails.cs Authentication\Authenticator.cs Authentication\AuthResult.cs Authentication\IAuthenticator.cs Dto\BaseRuleSet.cs Dto\CompanyCheckResult.cs Dto\CompanyTypeEnum.cs Dto\Contract.cs Dto\ContractHeader.cs Dto\ContractSubmission.cs Dto\CreditCheckData.cs Dto\CreditCheckDecisionEnum.cs Dto\CreditCheckResult.cs Dto\CreditDecision.cs Dto\DbDataValue.cs Dto\DatabaseLocation.cs Dto\DbMetaData.cs Dto\DbMetaDataDictionary.cs Repositories\BaseContractRepository.cs Managers\ContractManager.cs Dto\ContractStatus.cs Dto\DbDataValueDictionary.cs Dto\FieldValueDictionary.cs Managers\ContractStatusManager.cs Managers\IContractStatusManager.cs Managers\ICreditVetRuleSet.cs Util\AppInsights.cs Util\Constants.cs Util\ContractSubmissionGenerator.cs Repositories\IContractRepository.cs Dto\IFieldWithDependencySupport.cs Dto\ISiteFieldValidator.cs Dto\PopulatedField.cs Dto\FieldMetaData.cs Dto\StatusResponse.cs Dto\ValidatedSiteField.cs Dto\ValidationFailureType.cs Dto\ValidationRequest.cs Dto\ValidationResponse.cs Properties\AssemblyInfo.cs Util\IContractSubmissionGenerator.cs Repositories\IEntityDataRepository.cs Repositories\IFieldMetaDataRepository.cs Repositories\QuickQuoteRepository.cs Repositories\RegistrationRepository.cs Repositories\ContractDataRepository.cs Repositories\FieldMetaDataRepository.cs Dto\EntityType.cs Util\AppConfigReader.cs Util\EnumHelper.cs Util\Extensions.cs Repositories\IEntityRepository.cs Util\FieldDependencyHelper.cs Util\IUDLogger.cs Util\SiteDetailsConfigDecorator.cs Util\IConfigReader.cs Util\TypeHelper.cs "C:\Users\michael.tong\AppData\Local\Temp\.NETFramework,Version=v4.5.2.AssemblyAttributes.cs" ... Warnings here
- (チームシティーエージェントの作業ディレクトリ内からPowerShellのコマンドラインから実行する作業)
(動作しない - チームシティーで実行)探偵の仕事の数日後
ValidateSolutionConfiguration: Building solution configuration "Release|Any CPU". Project "C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\ContractManagement.Common.sln" (1) is building "C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\src\ContractManagement.Common\ContractManagement.Common.csproj" (2) on node 1 (default targets). CoreCompile: C:\Program Files (x86)\MSBuild\14.0\bin\amd64\csc.exe /noconfig /nowarn:1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE /highentropyva+ /reference:C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\packages\Dapper.1.50.2\lib\net451\Dapper.dll /reference:C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\packages\Microsoft.ApplicationInsights.2.2.0\lib\net45\Microsoft.ApplicationInsights.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\Microsoft.CSharp.dll" /reference:C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\packages\morelinq.2.1.0\lib\net35\MoreLinq.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\mscorlib.dll" /reference:C:\TeamCity\buildAgent\work\fd1026da6d1bbdb9\packages\Newtonsoft.Json.9.0.1\lib\net45\Newtonsoft.Json.dll /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.Configuration.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.Core.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.Data.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.dll" /reference:"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5.2\System.Xml.dll" /debug:pdbonly /filealign:512 /optimize+ /out:obj\Release\UdGroup.ContractManagement.Common.dll /subsystemversion:6.00 /target:library /utf8output Authentication\AuthDetails.cs Authentication\Authenticator.cs Authentication\AuthResult.cs Authentication\IAuthenticator.cs Dto\BaseRuleSet.cs Dto\CompanyCheckResult.cs Dto\CompanyTypeEnum.cs Dto\Contract.cs Dto\ContractHeader.cs Dto\ContractSubmission.cs Dto\CreditCheckData.cs Dto\CreditCheckDecisionEnum.cs Dto\CreditCheckResult.cs Dto\CreditDecision.cs Dto\DbDataValue.cs Dto\DatabaseLocation.cs Dto\DbMetaData.cs Dto\DbMetaDataDictionary.cs Repositories\BaseContractRepository.cs Managers\ContractManager.cs Dto\ContractStatus.cs Dto\DbDataValueDictionary.cs Dto\FieldValueDictionary.cs Managers\ContractStatusManager.cs Managers\IContractStatusManager.cs Managers\ICreditVetRuleSet.cs Util\AppInsights.cs Util\Constants.cs Util\ContractSubmissionGenerator.cs Repositories\IContractRepository.cs Dto\IFieldWithDependencySupport.cs Dto\ISiteFieldValidator.cs Dto\PopulatedField.cs Dto\FieldMetaData.cs Dto\StatusResponse.cs Dto\ValidatedSiteField.cs Dto\ValidationFailureType.cs Dto\ValidationRequest.cs Dto\ValidationResponse.cs Properties\AssemblyInfo.cs Util\IContractSubmissionGenerator.cs Repositories\IEntityDataRepository.cs Repositories\IFieldMetaDataRepository.cs Repositories\QuickQuoteRepository.cs Repositories\RegistrationRepository.cs Repositories\ContractDataRepository.cs Repositories\FieldMetaDataRepository.cs Dto\EntityType.cs Util\AppConfigReader.cs Util\EnumHelper.cs Util\Extensions.cs Repositories\IEntityRepository.cs Util\FieldDependencyHelper.cs Util\IUDLogger.cs Util\SiteDetailsConfigDecorator.cs Util\IConfigReader.cs Util\TypeHelper.cs "C:\TeamCity\buildAgent\temp\buildTmp\.NETFramework,Version=v4.5.2.AssemblyAttributes.cs"
最後に、オプション2を使用して、BuildAgentを実行するときに設定が自動的に設定されないということを意味するquirkをパッチしたTeamCity env変数を作成しましたサービスをユーザアカウントで実行します。 – TheLogicMan
env.APPDATA \t \t \t C:\ Users \ユーザーTeamCityAgent \のAppData \ローミング env.LOCALAPPDATA \t C:\ Users \ユーザーTeamCityAgent \のAppData \ローカル env.USERPROFILE \t \t C:\ Users \ユーザーTeamCityAgent – TheLogicMan