Jenkins 构建在 web 界面上失败但在 ant 上工作
Jenkins build fails on the web interface but works on ant
这是我从 Web 界面构建时得到的输出,但是当我从 CLI 构建时它是成功的。可能是什么问题呢?为什么詹金斯找不到它?我可以 运行 命令没有问题
Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/Symphony2/workspace
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url git@github.com:heroleads/deployment.git # timeout=10
Fetching upstream changes from git@github.com:heroleads/deployment.git
> git --version # timeout=10
using GIT_SSH to set credentials
> git -c core.askpass=true fetch --tags --progress git@github.com:heroleads/deployment.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/alpha^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/alpha^{commit} # timeout=10
Checking out Revision 39912e9529d983b6e9342caf42f898e17e2820a4 (refs/remotes/origin/alpha)
> git config core.sparsecheckout # timeout=10
> git checkout -f 39912e9529d983b6e9342caf42f898e17e2820a4
> git rev-list bcf31ba311d5d412ef2f268a72fdddf884318f5e # timeout=10
[workspace] $ ant
Buildfile: /var/lib/jenkins/jobs/Symphony2/workspace/build.xml
clean:
[delete] Deleting directory /var/lib/jenkins/jobs/Symphony2/workspace/app/build/api
[delete] Deleting directory /var/lib/jenkins/jobs/Symphony2/workspace/app/build/code-browser
[delete] Deleting directory /var/lib/jenkins/jobs/Symphony2/workspace/app/build/coverage
[delete] Deleting directory /var/lib/jenkins/jobs/Symphony2/workspace/app/build/logs
[delete] Deleting directory /var/lib/jenkins/jobs/Symphony2/workspace/app/build/pdepend
prepare:
[mkdir] Created dir: /var/lib/jenkins/jobs/Symphony2/workspace/app/build/api
[mkdir] Created dir: /var/lib/jenkins/jobs/Symphony2/workspace/app/build/code-browser
[mkdir] Created dir: /var/lib/jenkins/jobs/Symphony2/workspace/app/build/coverage
[mkdir] Created dir: /var/lib/jenkins/jobs/Symphony2/workspace/app/build/logs
[mkdir] Created dir: /var/lib/jenkins/jobs/Symphony2/workspace/app/build/pdepend
vendors:
[exec] Loading composer repositories with package information
[exec] Updating dependencies (including require-dev)
[exec] Nothing to install or update
[exec] Writing lock file
[exec] Generating autoload files
[exec] Updating the "app/config/parameters.yml" file
[exec] Clearing the cache for the dev environment with debug true
[exec] Trying to install assets as symbolic links.
[exec] Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework
[exec] The assets were installed using symbolic links.
[exec] Installing assets for Genemu\Bundle\FormBundle into web/bundles/genemuform
[exec] The assets were installed using symbolic links.
[exec] Installing assets for AppBundle into web/bundles/app
[exec] The assets were installed using symbolic links.
[exec] Installing assets for Acme\DemoBundle into web/bundles/acmedemo
[exec] The assets were installed using symbolic links.
[exec] Installing assets for Sensio\Bundle\DistributionBundle into web/bundles/sensiodistribution
[exec] The assets were installed using symbolic links.
parameters:
lint:
phploc:
[exec] phploc 2.1.1 by Sebastian Bergmann.
[exec]
[exec] Directories 24
[exec] Files 39
[exec]
[exec] Size
[exec] Lines of Code (LOC) 2954
[exec] Comment Lines of Code (CLOC) 1027 (34.77%)
[exec] Non-Comment Lines of Code (NCLOC) 1927 (65.23%)
[exec] Logical Lines of Code (LLOC) 521 (17.64%)
[exec] Classes 336 (64.49%)
[exec] Average Class Length 14
[exec] Minimum Class Length 0
[exec] Maximum Class Length 84
[exec] Average Method Length 2
[exec] Minimum Method Length 0
[exec] Maximum Method Length 24
[exec] Functions 42 (8.06%)
[exec] Average Function Length 2
[exec] Not in classes or functions 143 (27.45%)
[exec]
[exec] Cyclomatic Complexity
[exec] Average Complexity per LLOC 0.12
[exec] Average Complexity per Class 2.96
[exec] Minimum Class Complexity 1.00
[exec] Maximum Class Complexity 28.00
[exec] Average Complexity per Method 1.37
[exec] Minimum Method Complexity 1.00
[exec] Maximum Method Complexity 12.00
[exec]
[exec] Dependencies
[exec] Global Accesses 33
[exec] Global Constants 0 (0.00%)
[exec] Global Variables 0 (0.00%)
[exec] Super-Global Variables 33 (100.00%)
[exec] Attribute Accesses 95
[exec] Non-Static 95 (100.00%)
[exec] Static 0 (0.00%)
[exec] Method Calls 131
[exec] Non-Static 102 (77.86%)
[exec] Static 29 (22.14%)
[exec]
[exec] Structure
[exec] Namespaces 15
[exec] Interfaces 0
[exec] Traits 0
[exec] Classes 23
[exec] Abstract Classes 0 (0.00%)
[exec] Concrete Classes 23 (100.00%)
[exec] Methods 122
[exec] Scope
[exec] Non-Static Methods 111 (90.98%)
[exec] Static Methods 11 (9.02%)
[exec] Visibility
[exec] Public Methods 118 (96.72%)
[exec] Non-Public Methods 4 (3.28%)
[exec] Functions 16
[exec] Named Functions 2 (12.50%)
[exec] Anonymous Functions 14 (87.50%)
[exec] Constants 1
[exec] Global Constants 0 (0.00%)
[exec] Class Constants 1 (100.00%)
pdepend:
[exec] PHP_Depend 1.1.4 by Manuel Pichler
[exec]
[exec] Parsing source files:
[exec] ....................................... 39
[exec]
[exec] Executing Coupling-Analyzer:
[exec] ........... 233
[exec]
[exec] Executing CyclomaticComplexity-Analyzer:
[exec] ........... 235
[exec]
[exec] Executing Dependency-Analyzer:
[exec] ........ 162
[exec]
[exec] Executing Inheritance-Analyzer:
[exec] .. 46
[exec]
[exec] Executing NodeCount-Analyzer:
[exec] ........ 163
[exec]
[exec] Executing NodeLoc-Analyzer:
[exec] ......... 187
[exec]
[exec] Generating pdepend log files, this may take a moment.
[exec]
[exec] Time: 00:00; Memory: 12.25Mb
phpmd-ci:
phpcs-ci:
[exec] Result: 2
phpcpd:
[exec] phpcpd 2.0.2 by Sebastian Bergmann.
[exec]
[exec] Found 4 exact clones with 171 duplicated lines in 6 files:
[exec]
[exec] - /var/lib/jenkins/jobs/Symphony2/workspace/src/AppBundle/Resources/public/plugins/datatables/examples/server_side/scripts/ids-objects.php:42-80
[exec] /var/lib/jenkins/jobs/Symphony2/workspace/src/AppBundle/Resources/public/plugins/datatables/examples/server_side/scripts/objects.php:18-56
[exec]
[exec] - /var/lib/jenkins/jobs/Symphony2/workspace/src/AppBundle/Resources/public/plugins/datatables/examples/server_side/scripts/objects.php:8-56
[exec] /var/lib/jenkins/jobs/Symphony2/workspace/src/AppBundle/Resources/public/plugins/datatables/examples/server_side/scripts/post.php:22-70
[exec]
[exec] - /var/lib/jenkins/jobs/Symphony2/workspace/src/AppBundle/Resources/public/plugins/datatables/examples/server_side/scripts/jsonp.php:32-69
[exec] /var/lib/jenkins/jobs/Symphony2/workspace/src/AppBundle/Resources/public/plugins/datatables/examples/server_side/scripts/ids-arrays.php:42-79
[exec]
[exec] - /var/lib/jenkins/jobs/Symphony2/workspace/src/AppBundle/Resources/public/plugins/datatables/examples/server_side/scripts/jsonp.php:22-70
[exec] /var/lib/jenkins/jobs/Symphony2/workspace/src/AppBundle/Resources/public/plugins/datatables/examples/server_side/scripts/server_processing.php:22-70
[exec]
[exec] 5.79% duplicated lines out of 2954 total lines of code.
[exec]
[exec] Time: 409 ms, Memory: 4.75Mb
[exec] Result: 1
phpdox:
[exec] phpDox 0.7.0 - Copyright (C) 2010 - 2015 by Arne Blankerts
[exec]
[exec] [19.05.2015 - 13:49:34] Using config file '/var/lib/jenkins/jobs/Symphony2/workspace/app/Resources/jenkins/phpdox.xml'
[exec] [19.05.2015 - 13:49:34] Registered collector backend 'parser'
[exec] [19.05.2015 - 13:49:34] Registered enricher 'build'
[exec] [19.05.2015 - 13:49:34] Registered enricher 'git'
[exec] [19.05.2015 - 13:49:34] Registered enricher 'checkstyle'
[exec] [19.05.2015 - 13:49:34] Registered enricher 'phpcs'
[exec] [19.05.2015 - 13:49:34] Registered enricher 'pmd'
[exec] [19.05.2015 - 13:49:34] Registered enricher 'phpunit'
[exec] [19.05.2015 - 13:49:34] Registered enricher 'phploc'
[exec] [19.05.2015 - 13:49:34] Registered output engine 'xml'
[exec] [19.05.2015 - 13:49:34] Registered output engine 'html'
[exec] [19.05.2015 - 13:49:34] Starting to process project 'Symfony2 App'
[exec] [19.05.2015 - 13:49:34] Configuration change detected - cleaning cache
[exec] [19.05.2015 - 13:49:34] Starting collector
[exec] [19.05.2015 - 13:49:34] Scanning directory './src' for files to process
[exec]
[exec] ....................................... [39]
[exec]
[exec] [19.05.2015 - 13:49:34] Saving results to directory 'app/build/phpdox'
[exec] [19.05.2015 - 13:49:34] Resolving inheritance
[exec]
[exec] ....................... [23]
[exec]
[exec] [19.05.2015 - 13:49:34] The following unit(s) had missing dependencies during inheritance resolution:
[exec] [19.05.2015 - 13:49:34] - AppBundle\Form\RegistrationType (missing Symfony\Component\Form\AbstractType)
[exec] [19.05.2015 - 13:49:34] - AppBundle\EventListener\UserRegistrationListener (missing Symfony\Component\EventDispatcher\EventSubscriberInterface)
[exec] [19.05.2015 - 13:49:34] - AppBundle\AppBundle (missing Symfony\Component\HttpKernel\Bundle\Bundle)
[exec] [19.05.2015 - 13:49:34] - AppBundle\Tests\Controller\DefaultControllerTest (missing Symfony\Bundle\FrameworkBundle\Test\WebTestCase)
[exec] [19.05.2015 - 13:49:34] - AppBundle\Document\Asset (missing Solilokiam\SummernoteBundle\Model\SummernoteAsset)
[exec] [19.05.2015 - 13:49:34] - AppBundle\Controller\DefaultController (missing Symfony\Bundle\FrameworkBundle\Controller\Controller)
[exec] [19.05.2015 - 13:49:34] - AppBundle\Controller\TestController (missing Symfony\Bundle\FrameworkBundle\Controller\Controller)
[exec] [19.05.2015 - 13:49:34] - AppBundle\Controller\WelcomeController (missing Symfony\Bundle\FrameworkBundle\Controller\Controller)
[exec] [19.05.2015 - 13:49:34] - AppBundle\Entity\Account (missing FOS\UserBundle\Model\User)
[exec] [19.05.2015 - 13:49:34] - AppBundle\Entity\User (missing FOS\UserBundle\Model\User, HWI\Bundle\OAuthBundle\Connect\AccountConnectorInterface, HWI\Bundle\OAuthBundle\Security\Core\User\OAuthAwareUserProviderInterface)
[exec] [19.05.2015 - 13:49:34] - Acme\DemoBundle\Form\ContactType (missing Symfony\Component\Form\AbstractType)
[exec] [19.05.2015 - 13:49:34] - Acme\DemoBundle\AcmeDemoBundle (missing Symfony\Component\HttpKernel\Bundle\Bundle)
[exec] [19.05.2015 - 13:49:34] - Acme\DemoBundle\Command\HelloWorldCommand (missing Symfony\Component\Console\Command\Command)
[exec] [19.05.2015 - 13:49:34] - Acme\DemoBundle\Tests\Controller\DemoControllerTest (missing Symfony\Bundle\FrameworkBundle\Test\WebTestCase)
[exec] [19.05.2015 - 13:49:34] - Acme\DemoBundle\Twig\Extension\DemoExtension (missing Twig_Extension)
[exec] [19.05.2015 - 13:49:34] - Acme\DemoBundle\DependencyInjection\AcmeDemoExtension (missing Symfony\Component\HttpKernel\DependencyInjection\Extension)
[exec] [19.05.2015 - 13:49:34] - Acme\DemoBundle\Controller\SecuredController (missing Symfony\Bundle\FrameworkBundle\Controller\Controller)
[exec] [19.05.2015 - 13:49:34] - Acme\DemoBundle\Controller\WelcomeController (missing Symfony\Bundle\FrameworkBundle\Controller\Controller)
[exec] [19.05.2015 - 13:49:34] - Acme\DemoBundle\Controller\DemoController (missing Symfony\Bundle\FrameworkBundle\Controller\Controller)
[exec] [19.05.2015 - 13:49:34] Collector process completed
[exec]
[exec] [19.05.2015 - 13:49:34] Starting generator
[exec] [19.05.2015 - 13:49:34] Loading enrichers
[exec] [19.05.2015 - 13:49:34] Starting event loop.
[exec]
[exec] .................................................. [50]
[exec] .................................................. [100]
[exec] .................................................. [150]
[exec] .................................................. [200]
[exec] .................................................. [250]
[exec] .................................................. [300]
[exec] .................................................. [350]
[exec] .................................................. [400]
[exec] .......................... [426]
[exec]
[exec] [19.05.2015 - 13:49:35] Generator process completed
[exec] [19.05.2015 - 13:49:35] Processing project 'Symfony2 App' completed.
[exec]
[exec]
[exec] Time: 0 seconds, Memory: 9.00Mb
[exec]
phpunit:
[exec] PHPUnit 4.6.6 by Sebastian Bergmann and contributors.
[exec]
[exec] Configuration read from /var/lib/jenkins/jobs/Symphony2/workspace/app/build/phpunit.xml
[exec]
[exec]
[exec]
[exec] Time: 128 ms, Memory: 14.75Mb
[exec]
[exec] No tests executed!
phpcb:
BUILD FAILED
/var/lib/jenkins/jobs/Symphony2/workspace/build.xml:127: Execute failed: java.io.IOException: Cannot run program "phpcb": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
at java.lang.Runtime.exec(Runtime.java:617)
at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:41)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:428)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:442)
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:628)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:186)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
... 23 more
Total time: 36 seconds
Build step 'Invoke Ant' marked build as failure
[WARNINGS] Parsing warnings in console log with parser YUI Compressor
[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
[DRY] Collecting duplicate code analysis files...
[DRY] Finding all files that match the pattern build/logs/pmd-cpd.xml
Recording plot data
Publishing Clover coverage report...
Clover xml file does not exist in: /var/lib/jenkins/jobs/Symphony2/workspace called: build/logs/clover.xml and will not be copied to: /var/lib/jenkins/jobs/Symphony2/builds/13/cloverphp/clover.xml
Could not find 'build/coverage/build/logs/clover.xml'. Did you generate the XML report for Clover?
[CRAP4J] Collecting Crap4J analysis files...
[CRAP4J] Searching for report files within build/logs/crap4j.xml
[CRAP4J] Using the new FileSetBuilder
[CRAP4J] No crap4j report files were found. Configuration error?
Build step 'Report Crap' marked build as failure
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at BUILD level /var/lib/jenkins/jobs/Symphony2/workspace/build/api to /var/lib/jenkins/jobs/Symphony2/builds/13/htmlreports/API_Documentation
ERROR: Specified HTML directory '/var/lib/jenkins/jobs/Symphony2/workspace/build/api' does not exist.
[xUnit] [INFO] - Starting to record.
[xUnit] [INFO] - Processing PHPUnit-3.x (default)
[xUnit] [INFO] - [PHPUnit-3.x (default)] - No test report file(s) were found with the pattern 'build/logs/junit.xml' relative to '/var/lib/jenkins/jobs/Symphony2/workspace' for the testing framework 'PHPUnit-3.x (default)'. Did you enter a pattern relative to the correct directory? Did you generate the result report(s) for 'PHPUnit-3.x (default)'?
[xUnit] [ERROR] - No test reports found for the metric 'PHPUnit' with the resolved pattern 'build/logs/junit.xml'. Configuration error?.
[xUnit] [INFO] - Failing BUILD.
[xUnit] [INFO] - There are errors when processing test results.
[xUnit] [INFO] - Skipping tests recording.
[xUnit] [INFO] - Stop build.
[JDepend] JDepend plugin is ready
[JDepend] Couldn't generate JDepend file at 'build/logs/jdepend.xml'java.io.FileNotFoundException: /var/lib/jenkins/jobs/Symphony2/workspace/build/logs/jdepend.xml (No such file or directory)
Finished: FAILURE
Jenkins 以 jenkins
用户身份运行进程。确保 'phpcb' 和相关路径可供 jenkins
用户访问。
sudo su - jenkins
phpcb
如果上述方法不起作用,您需要为 jenkins
用户
正确 install/configure phpcb
错误是:
/var/lib/jenkins/jobs/Symphony2/workspace/build.xml:127: Execute failed: java.io.IOException: Cannot run program "phpcb": error=2, No such file or directory
当您说可以从命令行 运行 时,您的意思是:
- 您进入 Jenkins 并禁用了作业。 (这会阻止它在您尝试调试问题时构建。)
- 您登录了 运行ning Jenkins 的服务器。
- 您以 运行Jenkins 进程的用户身份登录。
- 您更改到目录'/var/lib/jenkins/jobs/Symphony2/workspace`
这是唯一真正的检查方法。
- 然后,您 运行 命令
ant
Buildfile: /var/lib/jenkins/jobs/Symphony2/workspace/build.xml
就像 Jenkins 所做的那样。
如果不是,您不能肯定地说它是从命令行构建的。
错误消息告诉您 Ant 找不到命令 phpcb
。这就是为什么您想以 Jenkins 用户身份登录并直接从 Jenkins 服务器上的命令行重新 运行 命令的原因。我打赌这与 phpcb
命令在 Jenkins 服务器上的位置(即,如果它实际安装了)和您的 $PATH
设置有关。尝试登录 Jenkins 服务器并输入 type phpcb
或 which phpcb
或 whence phpcb
并查看输出。如果它能找到 phpcb 命令,它会告诉你它位于哪个目录。
我的标准是将命令的实际位置的符号 link 放到 /usr/local/bin
或 /usr/share/bin
目录中,然后将那个目录放在我的 $PATH
.我什至将它放在 $PATH
的开头,以允许较新版本的命令覆盖系统默认值。
口头禅 但是,它在我的机器上运行™ 是我经常听到开发人员告诉我的一句老话。这意味着他们在他们的环境中的系统上有一些与官方规范不同的东西。我告诉他们,如果我不能建造它,它就不算数。 -- 并不是说我很苦涩...
顺便问一下,Phing 的状态是什么,它是 PHP 的 Ant 版本。 Phing 的任务是 PHP 特定的,整个程序是面向 PHP 的。 Phing 甚至 运行s 在 PHP 而不是 Java.
这是我从 Web 界面构建时得到的输出,但是当我从 CLI 构建时它是成功的。可能是什么问题呢?为什么詹金斯找不到它?我可以 运行 命令没有问题
Started by user anonymous
Building in workspace /var/lib/jenkins/jobs/Symphony2/workspace
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url git@github.com:heroleads/deployment.git # timeout=10
Fetching upstream changes from git@github.com:heroleads/deployment.git
> git --version # timeout=10
using GIT_SSH to set credentials
> git -c core.askpass=true fetch --tags --progress git@github.com:heroleads/deployment.git +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/alpha^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/alpha^{commit} # timeout=10
Checking out Revision 39912e9529d983b6e9342caf42f898e17e2820a4 (refs/remotes/origin/alpha)
> git config core.sparsecheckout # timeout=10
> git checkout -f 39912e9529d983b6e9342caf42f898e17e2820a4
> git rev-list bcf31ba311d5d412ef2f268a72fdddf884318f5e # timeout=10
[workspace] $ ant
Buildfile: /var/lib/jenkins/jobs/Symphony2/workspace/build.xml
clean:
[delete] Deleting directory /var/lib/jenkins/jobs/Symphony2/workspace/app/build/api
[delete] Deleting directory /var/lib/jenkins/jobs/Symphony2/workspace/app/build/code-browser
[delete] Deleting directory /var/lib/jenkins/jobs/Symphony2/workspace/app/build/coverage
[delete] Deleting directory /var/lib/jenkins/jobs/Symphony2/workspace/app/build/logs
[delete] Deleting directory /var/lib/jenkins/jobs/Symphony2/workspace/app/build/pdepend
prepare:
[mkdir] Created dir: /var/lib/jenkins/jobs/Symphony2/workspace/app/build/api
[mkdir] Created dir: /var/lib/jenkins/jobs/Symphony2/workspace/app/build/code-browser
[mkdir] Created dir: /var/lib/jenkins/jobs/Symphony2/workspace/app/build/coverage
[mkdir] Created dir: /var/lib/jenkins/jobs/Symphony2/workspace/app/build/logs
[mkdir] Created dir: /var/lib/jenkins/jobs/Symphony2/workspace/app/build/pdepend
vendors:
[exec] Loading composer repositories with package information
[exec] Updating dependencies (including require-dev)
[exec] Nothing to install or update
[exec] Writing lock file
[exec] Generating autoload files
[exec] Updating the "app/config/parameters.yml" file
[exec] Clearing the cache for the dev environment with debug true
[exec] Trying to install assets as symbolic links.
[exec] Installing assets for Symfony\Bundle\FrameworkBundle into web/bundles/framework
[exec] The assets were installed using symbolic links.
[exec] Installing assets for Genemu\Bundle\FormBundle into web/bundles/genemuform
[exec] The assets were installed using symbolic links.
[exec] Installing assets for AppBundle into web/bundles/app
[exec] The assets were installed using symbolic links.
[exec] Installing assets for Acme\DemoBundle into web/bundles/acmedemo
[exec] The assets were installed using symbolic links.
[exec] Installing assets for Sensio\Bundle\DistributionBundle into web/bundles/sensiodistribution
[exec] The assets were installed using symbolic links.
parameters:
lint:
phploc:
[exec] phploc 2.1.1 by Sebastian Bergmann.
[exec]
[exec] Directories 24
[exec] Files 39
[exec]
[exec] Size
[exec] Lines of Code (LOC) 2954
[exec] Comment Lines of Code (CLOC) 1027 (34.77%)
[exec] Non-Comment Lines of Code (NCLOC) 1927 (65.23%)
[exec] Logical Lines of Code (LLOC) 521 (17.64%)
[exec] Classes 336 (64.49%)
[exec] Average Class Length 14
[exec] Minimum Class Length 0
[exec] Maximum Class Length 84
[exec] Average Method Length 2
[exec] Minimum Method Length 0
[exec] Maximum Method Length 24
[exec] Functions 42 (8.06%)
[exec] Average Function Length 2
[exec] Not in classes or functions 143 (27.45%)
[exec]
[exec] Cyclomatic Complexity
[exec] Average Complexity per LLOC 0.12
[exec] Average Complexity per Class 2.96
[exec] Minimum Class Complexity 1.00
[exec] Maximum Class Complexity 28.00
[exec] Average Complexity per Method 1.37
[exec] Minimum Method Complexity 1.00
[exec] Maximum Method Complexity 12.00
[exec]
[exec] Dependencies
[exec] Global Accesses 33
[exec] Global Constants 0 (0.00%)
[exec] Global Variables 0 (0.00%)
[exec] Super-Global Variables 33 (100.00%)
[exec] Attribute Accesses 95
[exec] Non-Static 95 (100.00%)
[exec] Static 0 (0.00%)
[exec] Method Calls 131
[exec] Non-Static 102 (77.86%)
[exec] Static 29 (22.14%)
[exec]
[exec] Structure
[exec] Namespaces 15
[exec] Interfaces 0
[exec] Traits 0
[exec] Classes 23
[exec] Abstract Classes 0 (0.00%)
[exec] Concrete Classes 23 (100.00%)
[exec] Methods 122
[exec] Scope
[exec] Non-Static Methods 111 (90.98%)
[exec] Static Methods 11 (9.02%)
[exec] Visibility
[exec] Public Methods 118 (96.72%)
[exec] Non-Public Methods 4 (3.28%)
[exec] Functions 16
[exec] Named Functions 2 (12.50%)
[exec] Anonymous Functions 14 (87.50%)
[exec] Constants 1
[exec] Global Constants 0 (0.00%)
[exec] Class Constants 1 (100.00%)
pdepend:
[exec] PHP_Depend 1.1.4 by Manuel Pichler
[exec]
[exec] Parsing source files:
[exec] ....................................... 39
[exec]
[exec] Executing Coupling-Analyzer:
[exec] ........... 233
[exec]
[exec] Executing CyclomaticComplexity-Analyzer:
[exec] ........... 235
[exec]
[exec] Executing Dependency-Analyzer:
[exec] ........ 162
[exec]
[exec] Executing Inheritance-Analyzer:
[exec] .. 46
[exec]
[exec] Executing NodeCount-Analyzer:
[exec] ........ 163
[exec]
[exec] Executing NodeLoc-Analyzer:
[exec] ......... 187
[exec]
[exec] Generating pdepend log files, this may take a moment.
[exec]
[exec] Time: 00:00; Memory: 12.25Mb
phpmd-ci:
phpcs-ci:
[exec] Result: 2
phpcpd:
[exec] phpcpd 2.0.2 by Sebastian Bergmann.
[exec]
[exec] Found 4 exact clones with 171 duplicated lines in 6 files:
[exec]
[exec] - /var/lib/jenkins/jobs/Symphony2/workspace/src/AppBundle/Resources/public/plugins/datatables/examples/server_side/scripts/ids-objects.php:42-80
[exec] /var/lib/jenkins/jobs/Symphony2/workspace/src/AppBundle/Resources/public/plugins/datatables/examples/server_side/scripts/objects.php:18-56
[exec]
[exec] - /var/lib/jenkins/jobs/Symphony2/workspace/src/AppBundle/Resources/public/plugins/datatables/examples/server_side/scripts/objects.php:8-56
[exec] /var/lib/jenkins/jobs/Symphony2/workspace/src/AppBundle/Resources/public/plugins/datatables/examples/server_side/scripts/post.php:22-70
[exec]
[exec] - /var/lib/jenkins/jobs/Symphony2/workspace/src/AppBundle/Resources/public/plugins/datatables/examples/server_side/scripts/jsonp.php:32-69
[exec] /var/lib/jenkins/jobs/Symphony2/workspace/src/AppBundle/Resources/public/plugins/datatables/examples/server_side/scripts/ids-arrays.php:42-79
[exec]
[exec] - /var/lib/jenkins/jobs/Symphony2/workspace/src/AppBundle/Resources/public/plugins/datatables/examples/server_side/scripts/jsonp.php:22-70
[exec] /var/lib/jenkins/jobs/Symphony2/workspace/src/AppBundle/Resources/public/plugins/datatables/examples/server_side/scripts/server_processing.php:22-70
[exec]
[exec] 5.79% duplicated lines out of 2954 total lines of code.
[exec]
[exec] Time: 409 ms, Memory: 4.75Mb
[exec] Result: 1
phpdox:
[exec] phpDox 0.7.0 - Copyright (C) 2010 - 2015 by Arne Blankerts
[exec]
[exec] [19.05.2015 - 13:49:34] Using config file '/var/lib/jenkins/jobs/Symphony2/workspace/app/Resources/jenkins/phpdox.xml'
[exec] [19.05.2015 - 13:49:34] Registered collector backend 'parser'
[exec] [19.05.2015 - 13:49:34] Registered enricher 'build'
[exec] [19.05.2015 - 13:49:34] Registered enricher 'git'
[exec] [19.05.2015 - 13:49:34] Registered enricher 'checkstyle'
[exec] [19.05.2015 - 13:49:34] Registered enricher 'phpcs'
[exec] [19.05.2015 - 13:49:34] Registered enricher 'pmd'
[exec] [19.05.2015 - 13:49:34] Registered enricher 'phpunit'
[exec] [19.05.2015 - 13:49:34] Registered enricher 'phploc'
[exec] [19.05.2015 - 13:49:34] Registered output engine 'xml'
[exec] [19.05.2015 - 13:49:34] Registered output engine 'html'
[exec] [19.05.2015 - 13:49:34] Starting to process project 'Symfony2 App'
[exec] [19.05.2015 - 13:49:34] Configuration change detected - cleaning cache
[exec] [19.05.2015 - 13:49:34] Starting collector
[exec] [19.05.2015 - 13:49:34] Scanning directory './src' for files to process
[exec]
[exec] ....................................... [39]
[exec]
[exec] [19.05.2015 - 13:49:34] Saving results to directory 'app/build/phpdox'
[exec] [19.05.2015 - 13:49:34] Resolving inheritance
[exec]
[exec] ....................... [23]
[exec]
[exec] [19.05.2015 - 13:49:34] The following unit(s) had missing dependencies during inheritance resolution:
[exec] [19.05.2015 - 13:49:34] - AppBundle\Form\RegistrationType (missing Symfony\Component\Form\AbstractType)
[exec] [19.05.2015 - 13:49:34] - AppBundle\EventListener\UserRegistrationListener (missing Symfony\Component\EventDispatcher\EventSubscriberInterface)
[exec] [19.05.2015 - 13:49:34] - AppBundle\AppBundle (missing Symfony\Component\HttpKernel\Bundle\Bundle)
[exec] [19.05.2015 - 13:49:34] - AppBundle\Tests\Controller\DefaultControllerTest (missing Symfony\Bundle\FrameworkBundle\Test\WebTestCase)
[exec] [19.05.2015 - 13:49:34] - AppBundle\Document\Asset (missing Solilokiam\SummernoteBundle\Model\SummernoteAsset)
[exec] [19.05.2015 - 13:49:34] - AppBundle\Controller\DefaultController (missing Symfony\Bundle\FrameworkBundle\Controller\Controller)
[exec] [19.05.2015 - 13:49:34] - AppBundle\Controller\TestController (missing Symfony\Bundle\FrameworkBundle\Controller\Controller)
[exec] [19.05.2015 - 13:49:34] - AppBundle\Controller\WelcomeController (missing Symfony\Bundle\FrameworkBundle\Controller\Controller)
[exec] [19.05.2015 - 13:49:34] - AppBundle\Entity\Account (missing FOS\UserBundle\Model\User)
[exec] [19.05.2015 - 13:49:34] - AppBundle\Entity\User (missing FOS\UserBundle\Model\User, HWI\Bundle\OAuthBundle\Connect\AccountConnectorInterface, HWI\Bundle\OAuthBundle\Security\Core\User\OAuthAwareUserProviderInterface)
[exec] [19.05.2015 - 13:49:34] - Acme\DemoBundle\Form\ContactType (missing Symfony\Component\Form\AbstractType)
[exec] [19.05.2015 - 13:49:34] - Acme\DemoBundle\AcmeDemoBundle (missing Symfony\Component\HttpKernel\Bundle\Bundle)
[exec] [19.05.2015 - 13:49:34] - Acme\DemoBundle\Command\HelloWorldCommand (missing Symfony\Component\Console\Command\Command)
[exec] [19.05.2015 - 13:49:34] - Acme\DemoBundle\Tests\Controller\DemoControllerTest (missing Symfony\Bundle\FrameworkBundle\Test\WebTestCase)
[exec] [19.05.2015 - 13:49:34] - Acme\DemoBundle\Twig\Extension\DemoExtension (missing Twig_Extension)
[exec] [19.05.2015 - 13:49:34] - Acme\DemoBundle\DependencyInjection\AcmeDemoExtension (missing Symfony\Component\HttpKernel\DependencyInjection\Extension)
[exec] [19.05.2015 - 13:49:34] - Acme\DemoBundle\Controller\SecuredController (missing Symfony\Bundle\FrameworkBundle\Controller\Controller)
[exec] [19.05.2015 - 13:49:34] - Acme\DemoBundle\Controller\WelcomeController (missing Symfony\Bundle\FrameworkBundle\Controller\Controller)
[exec] [19.05.2015 - 13:49:34] - Acme\DemoBundle\Controller\DemoController (missing Symfony\Bundle\FrameworkBundle\Controller\Controller)
[exec] [19.05.2015 - 13:49:34] Collector process completed
[exec]
[exec] [19.05.2015 - 13:49:34] Starting generator
[exec] [19.05.2015 - 13:49:34] Loading enrichers
[exec] [19.05.2015 - 13:49:34] Starting event loop.
[exec]
[exec] .................................................. [50]
[exec] .................................................. [100]
[exec] .................................................. [150]
[exec] .................................................. [200]
[exec] .................................................. [250]
[exec] .................................................. [300]
[exec] .................................................. [350]
[exec] .................................................. [400]
[exec] .......................... [426]
[exec]
[exec] [19.05.2015 - 13:49:35] Generator process completed
[exec] [19.05.2015 - 13:49:35] Processing project 'Symfony2 App' completed.
[exec]
[exec]
[exec] Time: 0 seconds, Memory: 9.00Mb
[exec]
phpunit:
[exec] PHPUnit 4.6.6 by Sebastian Bergmann and contributors.
[exec]
[exec] Configuration read from /var/lib/jenkins/jobs/Symphony2/workspace/app/build/phpunit.xml
[exec]
[exec]
[exec]
[exec] Time: 128 ms, Memory: 14.75Mb
[exec]
[exec] No tests executed!
phpcb:
BUILD FAILED
/var/lib/jenkins/jobs/Symphony2/workspace/build.xml:127: Execute failed: java.io.IOException: Cannot run program "phpcb": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1047)
at java.lang.Runtime.exec(Runtime.java:617)
at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:41)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:428)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:442)
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:628)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:495)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:186)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1028)
... 23 more
Total time: 36 seconds
Build step 'Invoke Ant' marked build as failure
[WARNINGS] Parsing warnings in console log with parser YUI Compressor
[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
[DRY] Collecting duplicate code analysis files...
[DRY] Finding all files that match the pattern build/logs/pmd-cpd.xml
Recording plot data
Publishing Clover coverage report...
Clover xml file does not exist in: /var/lib/jenkins/jobs/Symphony2/workspace called: build/logs/clover.xml and will not be copied to: /var/lib/jenkins/jobs/Symphony2/builds/13/cloverphp/clover.xml
Could not find 'build/coverage/build/logs/clover.xml'. Did you generate the XML report for Clover?
[CRAP4J] Collecting Crap4J analysis files...
[CRAP4J] Searching for report files within build/logs/crap4j.xml
[CRAP4J] Using the new FileSetBuilder
[CRAP4J] No crap4j report files were found. Configuration error?
Build step 'Report Crap' marked build as failure
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at BUILD level /var/lib/jenkins/jobs/Symphony2/workspace/build/api to /var/lib/jenkins/jobs/Symphony2/builds/13/htmlreports/API_Documentation
ERROR: Specified HTML directory '/var/lib/jenkins/jobs/Symphony2/workspace/build/api' does not exist.
[xUnit] [INFO] - Starting to record.
[xUnit] [INFO] - Processing PHPUnit-3.x (default)
[xUnit] [INFO] - [PHPUnit-3.x (default)] - No test report file(s) were found with the pattern 'build/logs/junit.xml' relative to '/var/lib/jenkins/jobs/Symphony2/workspace' for the testing framework 'PHPUnit-3.x (default)'. Did you enter a pattern relative to the correct directory? Did you generate the result report(s) for 'PHPUnit-3.x (default)'?
[xUnit] [ERROR] - No test reports found for the metric 'PHPUnit' with the resolved pattern 'build/logs/junit.xml'. Configuration error?.
[xUnit] [INFO] - Failing BUILD.
[xUnit] [INFO] - There are errors when processing test results.
[xUnit] [INFO] - Skipping tests recording.
[xUnit] [INFO] - Stop build.
[JDepend] JDepend plugin is ready
[JDepend] Couldn't generate JDepend file at 'build/logs/jdepend.xml'java.io.FileNotFoundException: /var/lib/jenkins/jobs/Symphony2/workspace/build/logs/jdepend.xml (No such file or directory)
Finished: FAILURE
Jenkins 以 jenkins
用户身份运行进程。确保 'phpcb' 和相关路径可供 jenkins
用户访问。
sudo su - jenkins
phpcb
如果上述方法不起作用,您需要为 jenkins
用户
phpcb
错误是:
/var/lib/jenkins/jobs/Symphony2/workspace/build.xml:127: Execute failed: java.io.IOException: Cannot run program "phpcb": error=2, No such file or directory
当您说可以从命令行 运行 时,您的意思是:
- 您进入 Jenkins 并禁用了作业。 (这会阻止它在您尝试调试问题时构建。)
- 您登录了 运行ning Jenkins 的服务器。
- 您以 运行Jenkins 进程的用户身份登录。
- 您更改到目录'/var/lib/jenkins/jobs/Symphony2/workspace` 这是唯一真正的检查方法。
- 然后,您 运行 命令
ant Buildfile: /var/lib/jenkins/jobs/Symphony2/workspace/build.xml
就像 Jenkins 所做的那样。
如果不是,您不能肯定地说它是从命令行构建的。
错误消息告诉您 Ant 找不到命令 phpcb
。这就是为什么您想以 Jenkins 用户身份登录并直接从 Jenkins 服务器上的命令行重新 运行 命令的原因。我打赌这与 phpcb
命令在 Jenkins 服务器上的位置(即,如果它实际安装了)和您的 $PATH
设置有关。尝试登录 Jenkins 服务器并输入 type phpcb
或 which phpcb
或 whence phpcb
并查看输出。如果它能找到 phpcb 命令,它会告诉你它位于哪个目录。
我的标准是将命令的实际位置的符号 link 放到 /usr/local/bin
或 /usr/share/bin
目录中,然后将那个目录放在我的 $PATH
.我什至将它放在 $PATH
的开头,以允许较新版本的命令覆盖系统默认值。
口头禅 但是,它在我的机器上运行™ 是我经常听到开发人员告诉我的一句老话。这意味着他们在他们的环境中的系统上有一些与官方规范不同的东西。我告诉他们,如果我不能建造它,它就不算数。 -- 并不是说我很苦涩...
顺便问一下,Phing 的状态是什么,它是 PHP 的 Ant 版本。 Phing 的任务是 PHP 特定的,整个程序是面向 PHP 的。 Phing 甚至 运行s 在 PHP 而不是 Java.