2013-05-01 2 views
1

그래서 jenkins-php.org를 사용하여 프로젝트를 설정하려고했습니다. 불행히도 나는 오류가있다. 우선, xml 구성 파일 (phpmd 및 phpcd)을 어디에 넣어야합니까? 그리고 출발점으로 사용할 수있는 몇 가지 표준 구성이 있습니까?jenkins가 PHP 프로젝트를 설정했습니다 - 로그에 오류가 있습니다

그러나 로그 끝 부분에서 가장 눈에 띄는 것은 무엇입니까? 오류를 수정하려면 어떻게해야합니까?

Started by user anonymous 
Building in workspace /var/lib/jenkins/jobs/MyDemo/workspace 
Checkout:workspace//var/lib/jenkins/jobs/MyDemo/workspace - [email protected] 
Using strategy: Default 
Last Built Revision: Revision 3653bdb (origin/master, origin/HEAD) 
Fetching changes from 1 remote Git repository 
Fetching upstream changes from origin 
Seen branch in repository origin/HEAD 
Seen branch in repository origin/master 
Commencing build of Revision 9e40e86 (origin/master, origin/HEAD) 
Checking out Revision 9e40e86 (origin/master, origin/HEAD) 
Warning : There are multiple branch changesets here 
[workspace] $ ant 
Buildfile: /var/lib/jenkins/jobs/MyDemo/workspace/build.xml 

clean: 
[delete] Deleting directory /var/lib/jenkins/jobs/MyDemo/workspace/build/api 
[delete] Deleting directory /var/lib/jenkins/jobs/MyDemo/workspace/build/code-browser 
[delete] Deleting directory /var/lib/jenkins/jobs/MyDemo/workspace/build/coverage 
[delete] Deleting directory /var/lib/jenkins/jobs/MyDemo/workspace/build/logs 
[delete] Deleting directory /var/lib/jenkins/jobs/MyDemo/workspace/build/pdepend 

prepare: 
[mkdir] Created dir: /var/lib/jenkins/jobs/MyDemo/workspace/build/api 
[mkdir] Created dir: /var/lib/jenkins/jobs/MyDemo/workspace/build/code-browser 
[mkdir] Created dir: /var/lib/jenkins/jobs/MyDemo/workspace/build/coverage 
[mkdir] Created dir: /var/lib/jenkins/jobs/MyDemo/workspace/build/logs 
[mkdir] Created dir: /var/lib/jenkins/jobs/MyDemo/workspace/build/pdepend 

lint: 

phploc: 
[exec] phploc 1.7.4 by Sebastian Bergmann. 
[exec] 
[exec] Lines of Code (LOC): 9 
[exec] Cyclomatic Complexity/Lines of Code: 0.11 
[exec] Comment Lines of Code (CLOC): 0 
[exec] Non-Comment Lines of Code (NCLOC): 9 
[exec] 
[exec] Namespaces: 0 
[exec] Interfaces: 0 
[exec] Traits: 0 
[exec] Classes: 1 
[exec] Abstract: 0 (0.00%) 
[exec] Concrete: 1 (100.00%) 
[exec] Average Class Length (NCLOC): 7 
[exec] Methods: 1 
[exec] Scope: 
[exec] Non-Static: 1 (100.00%) 
[exec] Static: 0 (0.00%) 
[exec] Visibility: 
[exec] Public: 1 (100.00%) 
[exec] Non-Public: 0 (0.00%) 
[exec] Average Method Length (NCLOC): 7 
[exec] Cyclomatic Complexity/Number of Methods: 2.00 
[exec] 
[exec] Anonymous Functions: 0 
[exec] Functions: 0 
[exec] 
[exec] Constants: 0 
[exec] Global constants: 0 
[exec] Class constants: 0 

pdepend: 
[exec] PHP_Depend 1.1.0 by Manuel Pichler 
[exec] 
[exec] Parsing source files: 
[exec] . 1 
[exec] 
[exec] Executing Coupling-Analyzer: 
[exec] 4 
[exec] 
[exec] Executing CyclomaticComplexity-Analyzer: 
[exec] 4 
[exec] 
[exec] Executing Dependency-Analyzer: 
[exec] 3 
[exec] 
[exec] Executing Inheritance-Analyzer: 
[exec] 2 
[exec] 
[exec] Executing NodeCount-Analyzer: 
[exec] 3 
[exec] 
[exec] Executing NodeLoc-Analyzer: 
[exec] 4 
[exec] 
[exec] Generating pdepend log files, this may take a moment. 
[exec] 
[exec] Time: 00:00; Memory: 3.00Mb 

phpmd-ci: 
[exec] Cannot find specified rule-set "/var/lib/jenkins/jobs/MyDemo/workspace/build/phpmd.xml". 
[exec] Result: 1 

phpcs-ci: 
[exec] Result: 2 

phpcpd: 
[exec] phpcpd 1.4.1 by Sebastian Bergmann. 
[exec] 
[exec] 0.00% duplicated lines out of 9 total lines of code. 
[exec] 
[exec] Time: 0 seconds, Memory: 0.75Mb 

phpunit: 
[exec] PHPUnit 3.7.19 by Sebastian Bergmann. 
[exec] 
[exec] Configuration read from /var/lib/jenkins/jobs/MyDemo/workspace/phpunit.xml.dist 
[exec] 
[exec] . 
[exec] 
[exec] Time: 0 seconds, Memory: 3.00Mb 
[exec] 
[exec] OK (1 test, 1 assertion) 
[exec] 
[exec] Generating code coverage report in Clover XML format ... done 
[exec] 
[exec] Generating code coverage report in HTML format ... done 

phpcb: 
[exec] [Warning] Could not read file '/var/lib/jenkins/jobs/MyDemo/workspace/build/logs/pmd.xml'. Make sure it contains valid xml. 

build: 

BUILD SUCCESSFUL 
Total time: 4 seconds 
[CHECKSTYLE] Collecting checkstyle analysis files... 
[CHECKSTYLE] Finding all files that match the pattern build/logs/checkstyle.xml 
[PMD] Collecting PMD analysis files... 
[PMD] Finding all files that match the pattern build/logs/pmd.xml 
[PMD] Parsing 1 files in /var/lib/jenkins/jobs/MyDemo/workspace 
[PMD] Skipping file of module /var/lib/jenkins/jobs/MyDemo/workspace/build/logs/pmd.xml because it's empty. 
[DRY] Collecting duplicate code analysis files... 
[DRY] Finding all files that match the pattern build/logs/pmd-cpd.xml 
[DRY] Parsing 1 files in /var/lib/jenkins/jobs/MyDemo/workspace 
[DRY] Successfully parsed file /var/lib/jenkins/jobs/MyDemo/workspace/build/logs/pmd-cpd.xml of module with 0 warnings. 
Recording plot data 
Publishing Clover coverage report... 
Publishing Clover HTML report... 
Publishing Clover XML report... 
Publishing Clover coverage results... 
[htmlpublisher] Archiving HTML reports... 
[htmlpublisher] Archiving at BUILD level /var/lib/jenkins/jobs/MyDemo/workspace/build/api to /var/lib/jenkins/jobs/MyDemo/builds/2013-04-26_23-54-18/htmlreports/API_Documentation 
ERROR: Directory '/var/lib/jenkins/jobs/MyDemo/workspace/build/api' exists but failed copying to '/var/lib/jenkins/jobs/MyDemo/builds/2013-04-26_23-54-18/htmlreports/API_Documentation'. 
ERROR: This is especially strange since your build otherwise succeeded. 
Build step 'Publish HTML reports' changed build result to FAILURE 
[xUnit] [INFO] - Starting to record. 
[xUnit] [INFO] - Processing PHPUnit-3.x (default) 
[xUnit] [INFO] - [PHPUnit-3.x (default)] - 1 test report file(s) were found with the pattern 'build/logs/junit.xml' relative to '/var/lib/jenkins/jobs/MyDemo/workspace' for the testing framework 'PHPUnit-3.x (default)'. 
[xUnit] [INFO] - Check 'Failed Tests' threshold. 
[xUnit] [INFO] - Check 'Skipped Tests' threshold. 
[xUnit] [INFO] - Setting the build status to FAILURE 
[xUnit] [INFO] - Stopping recording. 
[JDepend] JDepend plugin is ready 
[JDepend] Found 1 classes in 1 packages 
ERROR: Publisher hudson.plugins.violations.ViolationsPublisher aborted due to exception 
java.io.EOFException: input contained no data 
at org.xmlpull.mxp1.MXParser.fillBuf(MXParser.java:3003) 
at org.xmlpull.mxp1.MXParser.more(MXParser.java:3046) 
at org.xmlpull.mxp1.MXParser.parseProlog(MXParser.java:1410) 
at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1395) 
at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093) 
at hudson.plugins.violations.parse.AbstractParser.expectNextTag(AbstractParser.java:262) 
at hudson.plugins.violations.types.pmd.PMDParser.execute(PMDParser.java:39) 
at hudson.plugins.violations.parse.AbstractTypeParser.parse(AbstractTypeParser.java:57) 
at hudson.plugins.violations.ViolationsCollector.doType(ViolationsCollector.java:187) 
at hudson.plugins.violations.ViolationsCollector.invoke(ViolationsCollector.java:114) 
at hudson.plugins.violations.ViolationsCollector.invoke(ViolationsCollector.java:25) 
at hudson.FilePath.act(FilePath.java:904) 
at hudson.FilePath.act(FilePath.java:877) 
at hudson.plugins.violations.ViolationsPublisher.perform(ViolationsPublisher.java:74) 
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36) 
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:802) 
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:774) 
at hudson.model.Build$BuildExecution.post2(Build.java:183) 
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:724) 
at hudson.model.Run.execute(Run.java:1600) 
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46) 
at hudson.model.ResourceController.execute(ResourceController.java:88) 
at hudson.model.Executor.run(Executor.java:237) 
Finished: FAILURE 
+0

jenkins 프로젝트의 config 섹션에는이 오류가 사라지는 "코드 브라우저"를 삭제하면 "html 보고서 게시"라는 점이 있습니다. 그러나 나를 위해 다른 사람들이 튀어 오릅니다. 나는 "jenkins-php.org"템플릿이 전혀 쓸모없는 것 같다. 어쩌면 구식일까요? – DarsVaeda

답변

2

구성 파일의 경우 http://jenkins-php.org 사이트에서 코드를 복사 할 수 있습니다. 페이지 아래로 3/4 정도가 PHPUnit, phpDox, PHP_CodeSniffer 및 PHPMD의 예입니다.

파일을 저장할 위치는 거의 어디에서나 찾을 수 있도록 작업을 구성 할 수 있지만 기본적으로 IIRC는 프로젝트 루트 디렉토리의 빌드 폴더에 파일을 저장합니다. 이가 실행되고 어떤 OS 아는 당신이 구성이 모든 정렬 파일을 얻을 여전히 오류가 나는, 권한 문제로 보일 것이다이있는 경우

우리의 프로젝트 루트 디렉토리는이

root 
|-- build... 
| |-- phpmd.xml 
| `-- phpunit.xml 
`-- src ... 
| |-- our PHP applications code 
| `-- ... 
`-- build.xml 

과 같이 보입니다 당신은 젠킨스가

+0

고마워, 나는 apt-get를 통해 설치했다. 나는이 설정으로 우분투 13.04에있다. 이러한 파일을 빌드 폴더에 복사하고 루트에 있던 파일을 복사하는 데 도움이되었습니다. 하지만 여전히 파일을 복사 할 수없는 빌드가 끝날 때 오류가 발생합니다 ... – DarsVaeda

+0

그 다음 내 문제를 해결 한 경우 받아 들여주세요, 제 담당자를 구축하려고합니다. – Rockstar04

+0

나는 당신을 선정했습니다. 그것은 부분적으로 해결되었지만, 결국 실제 오류는 여전히 풀리지 않습니다. 지금까지 감사합니다! :) – DarsVaeda

1

첫 번째 예외 내가 생을 생각

phpmd-ci: 
[exec] Cannot find specified rule-set "/var/lib/jenkins/jobs/MyDemo/workspace/build/phpmd.xml". 
[exec] Result: 1 

이다 (수동 다운로드 대 아파트 패키지를 설치) 도움이 될 수 있습니다 설치 방법 s 구성 파일이 구식입니다. 그래서 규칙 집합을 찾지 못했습니다. 나는 거기에서 규칙 집합을 정의함으로써 build.xml 파일을 변경함으로써이를 해결할 수 있었다.

원래 phpmd의 설정 :

<target name="phpmd-ci" description="Perform project mess detection using PHPMD creating a log file for the continuous integration server"> 
    <exec executable="phpmd"> 
    <arg path="${basedir}/src" /> 
    <arg value="xml" /> 
    <arg value="${basedir}/build/phpmd.xml" /> 
    <arg value="--reportfile" /> 
    <arg value="${basedir}/build/logs/pmd.xml" /> 
    </exec> 
</target> 

변경된 설정 :

<target name="phpmd-ci" description="Perform project mess detection using PHPMD creating a log file for the continuous integration server"> 
    <exec executable="phpmd"> 
    <arg path="${basedir}/src" /> 
    <arg value="xml" />   
    <arg value="codesize,unusedcode,naming,design" /> 
    <arg value="--reportfile" /> 
    <arg value="${basedir}/build/logs/pmd.xml" /> 
    </exec> 
</target> 

phpmd 지금 생성하는 보고서 파일과 마지막 예외도 해결 될 것입니다.

0

은 다음과 같은 내용으로 파일을 phpdox.xml 를 만들어보십시오 :

<?xml version="1.0" encoding="utf-8" ?> 
<phpdox xmlns="http://xml.phpdox.net/config"> 
    <project name="phpdox" source="../library" workdir="../build/phpdox"> 
     <collector publiconly="false"> 
      <include mask="../**/*.php" /> 
      <exclude mask="../vendor/**"/> 
      <exclude mask="*Autoload.php" /> 
     </collector> 

     <generator output="../build"> 
      <build engine="html" enabled="true" output="api"> 
       <file extension="html" /> 
      </build> 
     </generator> 
    </project> 
</phpdox> 

나는 당신을 도움이되기를 바랍니다.

관련 문제