Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: Elexy/CIPS
base: 5c4573fb46
...
head fork: Elexy/CIPS
compare: e5ccbe6ea7
  • 15 commits
  • 707 files changed
  • 0 commit comments
  • 2 contributors
Showing with 1,005 additions and 33,989 deletions.
  1. +3 −1 .gitignore
  2. +16 −1 README.md
  3. +1 −1  cips
  4. +15 −0 composer.json
  5. +503 −0 composer.lock
  6. +1 −0  data/postReceive.txt
  7. +14 −0 phpdoc.dist.xml
  8. +175 −0 src/Cips/Build.php
  9. +11 −4 src/Cips/Projects/GitProject.php
  10. +43 −15 src/Cips/Projects/Project.php
  11. +150 −128 src/app.php
  12. +15 −18 src/bootstrap.php
  13. +4 −4 src/console.php
  14. +1 −1  tests/phpunit.xml
  15. +3 −3 tests/unit/GitProjectTest.php
  16. +47 −23 tests/unit/ProjectTest.php
  17. +3 −3 tests/unit/SvnProjectTest.php
  18. +0 −809 vendor/Symfony/Component/Console/Application.php
  19. +0 −576 vendor/Symfony/Component/Console/Command/Command.php
  20. +0 −82 vendor/Symfony/Component/Console/Command/HelpCommand.php
  21. +0 −67 vendor/Symfony/Component/Console/Command/ListCommand.php
  22. +0 −243 vendor/Symfony/Component/Console/Formatter/OutputFormatter.php
  23. +0 −83 vendor/Symfony/Component/Console/Formatter/OutputFormatterInterface.php
  24. +0 −217 vendor/Symfony/Component/Console/Formatter/OutputFormatterStyle.php
  25. +0 −77 vendor/Symfony/Component/Console/Formatter/OutputFormatterStyleInterface.php
  26. +0 −110 vendor/Symfony/Component/Console/Helper/DialogHelper.php
  27. +0 −91 vendor/Symfony/Component/Console/Helper/FormatterHelper.php
  28. +0 −42 vendor/Symfony/Component/Console/Helper/Helper.php
  29. +0 −49 vendor/Symfony/Component/Console/Helper/HelperInterface.php
  30. +0 −102 vendor/Symfony/Component/Console/Helper/HelperSet.php
  31. +0 −307 vendor/Symfony/Component/Console/Input/ArgvInput.php
  32. +0 −194 vendor/Symfony/Component/Console/Input/ArrayInput.php
  33. +0 −211 vendor/Symfony/Component/Console/Input/Input.php
  34. +0 −132 vendor/Symfony/Component/Console/Input/InputArgument.php
  35. +0 −508 vendor/Symfony/Component/Console/Input/InputDefinition.php
  36. +0 −103 vendor/Symfony/Component/Console/Input/InputInterface.php
  37. +0 −182 vendor/Symfony/Component/Console/Input/InputOption.php
  38. +0 −78 vendor/Symfony/Component/Console/Input/StringInput.php
  39. +0 −19 vendor/Symfony/Component/Console/LICENSE
  40. +0 −46 vendor/Symfony/Component/Console/Output/ConsoleOutput.php
  41. +0 −34 vendor/Symfony/Component/Console/Output/NullOutput.php
  42. +0 −186 vendor/Symfony/Component/Console/Output/Output.php
  43. +0 −107 vendor/Symfony/Component/Console/Output/OutputInterface.php
  44. +0 −112 vendor/Symfony/Component/Console/Output/StreamOutput.php
  45. +0 −136 vendor/Symfony/Component/Console/Shell.php
  46. +0 −100 vendor/Symfony/Component/Console/Tester/ApplicationTester.php
  47. +0 −100 vendor/Symfony/Component/Console/Tester/CommandTester.php
  48. +0 −72 vendor/Symfony/Component/Process/ExecutableFinder.php
  49. +0 −19 vendor/Symfony/Component/Process/LICENSE
  50. +0 −59 vendor/Symfony/Component/Process/PhpExecutableFinder.php
  51. +0 −78 vendor/Symfony/Component/Process/PhpProcess.php
  52. +0 −365 vendor/Symfony/Component/Process/Process.php
  53. BIN  vendor/silex.phar
  54. +0 −61 vendor/swift/CHANGES
  55. +0 −165 vendor/swift/LICENSE
  56. +0 −30 vendor/swift/README
  57. +0 −1  vendor/swift/VERSION
  58. +0 −57 vendor/swift/lib/classes/Swift.php
  59. +0 −75 vendor/swift/lib/classes/Swift/Attachment.php
  60. +0 −178 vendor/swift/lib/classes/Swift/ByteStream/AbstractFilterableInputStream.php
  61. +0 −190 vendor/swift/lib/classes/Swift/ByteStream/ArrayByteStream.php
  62. +0 −177 vendor/swift/lib/classes/Swift/ByteStream/FileByteStream.php
  63. +0 −60 vendor/swift/lib/classes/Swift/CharacterReader.php
  64. +0 −96 vendor/swift/lib/classes/Swift/CharacterReader/GenericFixedWidthReader.php
  65. +0 −83 vendor/swift/lib/classes/Swift/CharacterReader/UsAsciiReader.php
  66. +0 −183 vendor/swift/lib/classes/Swift/CharacterReader/Utf8Reader.php
  67. +0 −29 vendor/swift/lib/classes/Swift/CharacterReaderFactory.php
  68. +0 −119 vendor/swift/lib/classes/Swift/CharacterReaderFactory/SimpleCharacterReaderFactory.php
  69. +0 −86 vendor/swift/lib/classes/Swift/CharacterStream.php
  70. +0 −319 vendor/swift/lib/classes/Swift/CharacterStream/ArrayCharacterStream.php
  71. +0 −300 vendor/swift/lib/classes/Swift/CharacterStream/NgCharacterStream.php
  72. +0 −349 vendor/swift/lib/classes/Swift/DependencyContainer.php
  73. +0 −30 vendor/swift/lib/classes/Swift/DependencyException.php
  74. +0 −73 vendor/swift/lib/classes/Swift/EmbeddedFile.php
  75. +0 −32 vendor/swift/lib/classes/Swift/Encoder.php
  76. +0 −63 vendor/swift/lib/classes/Swift/Encoder/Base64Encoder.php
  77. +0 −263 vendor/swift/lib/classes/Swift/Encoder/QpEncoder.php
  78. +0 −89 vendor/swift/lib/classes/Swift/Encoder/Rfc2231Encoder.php
  79. +0 −70 vendor/swift/lib/classes/Swift/Encoding.php
  80. +0 −67 vendor/swift/lib/classes/Swift/Events/CommandEvent.php
  81. +0 −29 vendor/swift/lib/classes/Swift/Events/CommandListener.php
  82. +0 −39 vendor/swift/lib/classes/Swift/Events/Event.php
  83. +0 −81 vendor/swift/lib/classes/Swift/Events/EventDispatcher.php
  84. +0 −19 vendor/swift/lib/classes/Swift/Events/EventListener.php
  85. +0 −65 vendor/swift/lib/classes/Swift/Events/EventObject.php
  86. +0 −65 vendor/swift/lib/classes/Swift/Events/ResponseEvent.php
  87. +0 −29 vendor/swift/lib/classes/Swift/Events/ResponseListener.php
  88. +0 −127 vendor/swift/lib/classes/Swift/Events/SendEvent.php
  89. +0 −35 vendor/swift/lib/classes/Swift/Events/SendListener.php
  90. +0 −175 vendor/swift/lib/classes/Swift/Events/SimpleEventDispatcher.php
  91. +0 −31 vendor/swift/lib/classes/Swift/Events/TransportChangeEvent.php
  92. +0 −53 vendor/swift/lib/classes/Swift/Events/TransportChangeListener.php
  93. +0 −50 vendor/swift/lib/classes/Swift/Events/TransportExceptionEvent.php
  94. +0 −30 vendor/swift/lib/classes/Swift/Events/TransportExceptionListener.php
  95. +0 −48 vendor/swift/lib/classes/Swift/FailoverTransport.php
  96. +0 −28 vendor/swift/lib/classes/Swift/FileStream.php
  97. +0 −34 vendor/swift/lib/classes/Swift/Filterable.php
  98. +0 −62 vendor/swift/lib/classes/Swift/Image.php
  99. +0 −72 vendor/swift/lib/classes/Swift/InputByteStream.php
  100. +0 −30 vendor/swift/lib/classes/Swift/IoException.php
  101. +0 −99 vendor/swift/lib/classes/Swift/KeyCache.php
  102. +0 −209 vendor/swift/lib/classes/Swift/KeyCache/ArrayKeyCache.php
  103. +0 −316 vendor/swift/lib/classes/Swift/KeyCache/DiskKeyCache.php
  104. +0 −53 vendor/swift/lib/classes/Swift/KeyCache/KeyCacheInputStream.php
  105. +0 −110 vendor/swift/lib/classes/Swift/KeyCache/NullKeyCache.php
  106. +0 −131 vendor/swift/lib/classes/Swift/KeyCache/SimpleKeyCacheInputStream.php
  107. +0 −48 vendor/swift/lib/classes/Swift/LoadBalancedTransport.php
  108. +0 −48 vendor/swift/lib/classes/Swift/MailTransport.php
  109. +0 −173 vendor/swift/lib/classes/Swift/Mailer.php
  110. +0 −59 vendor/swift/lib/classes/Swift/Mailer/ArrayRecipientIterator.php
  111. +0 −34 vendor/swift/lib/classes/Swift/Mailer/RecipientIterator.php
  112. +0 −82 vendor/swift/lib/classes/Swift/Message.php
  113. +0 −143 vendor/swift/lib/classes/Swift/Mime/Attachment.php
  114. +0 −26 vendor/swift/lib/classes/Swift/Mime/CharsetObserver.php
  115. +0 −41 vendor/swift/lib/classes/Swift/Mime/ContentEncoder.php
  116. +0 −81 vendor/swift/lib/classes/Swift/Mime/ContentEncoder/Base64ContentEncoder.php
  117. +0 −175 vendor/swift/lib/classes/Swift/Mime/ContentEncoder/PlainContentEncoder.php
  118. +0 −117 vendor/swift/lib/classes/Swift/Mime/ContentEncoder/QpContentEncoder.php
  119. +0 −51 vendor/swift/lib/classes/Swift/Mime/EmbeddedFile.php
  120. +0 −28 vendor/swift/lib/classes/Swift/Mime/EncodingObserver.php
  121. +0 −85 vendor/swift/lib/classes/Swift/Mime/Header.php
  122. +0 −28 vendor/swift/lib/classes/Swift/Mime/HeaderEncoder.php
  123. +0 −36 vendor/swift/lib/classes/Swift/Mime/HeaderEncoder/Base64HeaderEncoder.php
  124. +0 −99 vendor/swift/lib/classes/Swift/Mime/HeaderEncoder/QpHeaderEncoder.php
  125. +0 −72 vendor/swift/lib/classes/Swift/Mime/HeaderFactory.php
  126. +0 −170 vendor/swift/lib/classes/Swift/Mime/HeaderSet.php
  127. +0 −596 vendor/swift/lib/classes/Swift/Mime/Headers/AbstractHeader.php
  128. +0 −118 vendor/swift/lib/classes/Swift/Mime/Headers/DateHeader.php
  129. +0 −161 vendor/swift/lib/classes/Swift/Mime/Headers/IdentificationHeader.php
  130. +0 −316 vendor/swift/lib/classes/Swift/Mime/Headers/MailboxHeader.php
  131. +0 −274 vendor/swift/lib/classes/Swift/Mime/Headers/ParameterizedHeader.php
  132. +0 −126 vendor/swift/lib/classes/Swift/Mime/Headers/PathHeader.php
  133. +0 −108 vendor/swift/lib/classes/Swift/Mime/Headers/UnstructuredHeader.php
  134. +0 −230 vendor/swift/lib/classes/Swift/Mime/Message.php
  135. +0 −108 vendor/swift/lib/classes/Swift/Mime/MimeEntity.php
  136. +0 −196 vendor/swift/lib/classes/Swift/Mime/MimePart.php
  137. +0 −35 vendor/swift/lib/classes/Swift/Mime/ParameterizedHeader.php
  138. +0 −187 vendor/swift/lib/classes/Swift/Mime/SimpleHeaderFactory.php
  139. +0 −396 vendor/swift/lib/classes/Swift/Mime/SimpleHeaderSet.php
  140. +0 −609 vendor/swift/lib/classes/Swift/Mime/SimpleMessage.php
  141. +0 −803 vendor/swift/lib/classes/Swift/Mime/SimpleMimeEntity.php
  142. +0 −65 vendor/swift/lib/classes/Swift/MimePart.php
  143. +0 −41 vendor/swift/lib/classes/Swift/OutputByteStream.php
  144. +0 −147 vendor/swift/lib/classes/Swift/Plugins/AntiFloodPlugin.php
  145. +0 −173 vendor/swift/lib/classes/Swift/Plugins/BandwidthMonitorPlugin.php
  146. +0 −36 vendor/swift/lib/classes/Swift/Plugins/Decorator/Replacements.php
  147. +0 −201 vendor/swift/lib/classes/Swift/Plugins/DecoratorPlugin.php
  148. +0 −37 vendor/swift/lib/classes/Swift/Plugins/Logger.php
  149. +0 −160 vendor/swift/lib/classes/Swift/Plugins/LoggerPlugin.php
  150. +0 −73 vendor/swift/lib/classes/Swift/Plugins/Loggers/ArrayLogger.php
  151. +0 −64 vendor/swift/lib/classes/Swift/Plugins/Loggers/EchoLogger.php
  152. +0 −36 vendor/swift/lib/classes/Swift/Plugins/Pop/Pop3Connection.php
  153. +0 −34 vendor/swift/lib/classes/Swift/Plugins/Pop/Pop3Exception.php
  154. +0 −288 vendor/swift/lib/classes/Swift/Plugins/PopBeforeSmtpPlugin.php
  155. +0 −36 vendor/swift/lib/classes/Swift/Plugins/Reporter.php
  156. +0 −82 vendor/swift/lib/classes/Swift/Plugins/ReporterPlugin.php
  157. +0 −63 vendor/swift/lib/classes/Swift/Plugins/Reporters/HitReporter.php
  158. +0 −47 vendor/swift/lib/classes/Swift/Plugins/Reporters/HtmlReporter.php
  159. +0 −26 vendor/swift/lib/classes/Swift/Plugins/Sleeper.php
  160. +0 −188 vendor/swift/lib/classes/Swift/Plugins/ThrottlerPlugin.php
  161. +0 −26 vendor/swift/lib/classes/Swift/Plugins/Timer.php
  162. +0 −76 vendor/swift/lib/classes/Swift/Preferences.php
  163. +0 −27 vendor/swift/lib/classes/Swift/ReplacementFilterFactory.php
  164. +0 −30 vendor/swift/lib/classes/Swift/RfcComplianceException.php
  165. +0 −48 vendor/swift/lib/classes/Swift/SendmailTransport.php
  166. +0 −56 vendor/swift/lib/classes/Swift/SmtpTransport.php
  167. +0 −33 vendor/swift/lib/classes/Swift/StreamFilter.php
  168. +0 −188 vendor/swift/lib/classes/Swift/StreamFilters/ByteArrayReplacementFilter.php
  169. +0 −66 vendor/swift/lib/classes/Swift/StreamFilters/StringReplacementFilter.php
  170. +0 −53 vendor/swift/lib/classes/Swift/StreamFilters/StringReplacementFilterFactory.php
  171. +0 −28 vendor/swift/lib/classes/Swift/SwiftException.php
  172. +0 −60 vendor/swift/lib/classes/Swift/Transport.php
  173. +0 −543 vendor/swift/lib/classes/Swift/Transport/AbstractSmtpTransport.php
  174. +0 −88 vendor/swift/lib/classes/Swift/Transport/Esmtp/Auth/CramMd5Authenticator.php
  175. +0 −58 vendor/swift/lib/classes/Swift/Transport/Esmtp/Auth/LoginAuthenticator.php
  176. +0 −57 vendor/swift/lib/classes/Swift/Transport/Esmtp/Auth/PlainAuthenticator.php
  177. +0 −262 vendor/swift/lib/classes/Swift/Transport/Esmtp/AuthHandler.php
  178. +0 −38 vendor/swift/lib/classes/Swift/Transport/Esmtp/Authenticator.php
  179. +0 −82 vendor/swift/lib/classes/Swift/Transport/EsmtpHandler.php
  180. +0 −340 vendor/swift/lib/classes/Swift/Transport/EsmtpTransport.php
  181. +0 −97 vendor/swift/lib/classes/Swift/Transport/FailoverTransport.php
  182. +0 −65 vendor/swift/lib/classes/Swift/Transport/IoBuffer.php
  183. +0 −188 vendor/swift/lib/classes/Swift/Transport/LoadBalancedTransport.php
  184. +0 −36 vendor/swift/lib/classes/Swift/Transport/MailInvoker.php
  185. +0 −242 vendor/swift/lib/classes/Swift/Transport/MailTransport.php
  186. +0 −173 vendor/swift/lib/classes/Swift/Transport/SendmailTransport.php
  187. +0 −58 vendor/swift/lib/classes/Swift/Transport/SimpleMailInvoker.php
  188. +0 −36 vendor/swift/lib/classes/Swift/Transport/SmtpAgent.php
  189. +0 −276 vendor/swift/lib/classes/Swift/Transport/StreamBuffer.php
  190. +0 −31 vendor/swift/lib/classes/Swift/TransportException.php
  191. +0 −25 vendor/swift/lib/dependency_maps/cache_deps.php
  192. +0 −97 vendor/swift/lib/dependency_maps/mime_deps.php
  193. +0 −62 vendor/swift/lib/dependency_maps/transport_deps.php
  194. +0 −76 vendor/swift/lib/mime_types.php
  195. +0 −20 vendor/swift/lib/preferences.php
  196. +0 −21 vendor/swift/lib/swift_init.php
  197. +0 −22 vendor/swift/lib/swift_required.php
  198. +0 −22 vendor/swift/lib/swift_required_pear.php
  199. +0 −7 vendor/swift/test-suite/CHANGES
  200. +0 −165 vendor/swift/test-suite/LICENSE
  201. +0 −159 vendor/swift/test-suite/README
  202. +0 −65 vendor/swift/test-suite/config.php
  203. +0 −40 vendor/swift/test-suite/index.php
  204. +0 −69 vendor/swift/test-suite/lib/Sweety/Reporter.php
  205. +0 −203 vendor/swift/test-suite/lib/Sweety/Reporter/CliReporter.php
  206. +0 −160 vendor/swift/test-suite/lib/Sweety/Reporter/CliTestCaseReporter.php
  207. +0 −174 vendor/swift/test-suite/lib/Sweety/Reporter/HtmlReporter.php
  208. +0 −174 vendor/swift/test-suite/lib/Sweety/Reporter/HtmlTestCaseReporter.php
  209. +0 −56 vendor/swift/test-suite/lib/Sweety/Runner.php
  210. +0 −365 vendor/swift/test-suite/lib/Sweety/Runner/AbstractTestRunner.php
  211. +0 −128 vendor/swift/test-suite/lib/Sweety/Runner/CliRunner.php
  212. +0 −160 vendor/swift/test-suite/lib/Sweety/Runner/HtmlRunner.php
  213. +0 −25 vendor/swift/test-suite/lib/Sweety/TestLocator.php
  214. +0 −71 vendor/swift/test-suite/lib/Sweety/TestLocator/PearStyleLocator.php
  215. +0 −383 vendor/swift/test-suite/lib/simpletest/HELP_MY_TESTS_DONT_WORK_ANYMORE
  216. +0 −502 vendor/swift/test-suite/lib/simpletest/LICENSE
  217. +0 −108 vendor/swift/test-suite/lib/simpletest/README
  218. +0 −176 vendor/swift/test-suite/lib/simpletest/TODO.xml
  219. +0 −1  vendor/swift/test-suite/lib/simpletest/VERSION
  220. +0 −237 vendor/swift/test-suite/lib/simpletest/authentication.php
  221. +0 −97 vendor/swift/test-suite/lib/simpletest/autorun.php
  222. +0 −1,094 vendor/swift/test-suite/lib/simpletest/browser.php
  223. +0 −122 vendor/swift/test-suite/lib/simpletest/collector.php
  224. +0 −166 vendor/swift/test-suite/lib/simpletest/compatibility.php
  225. +0 −380 vendor/swift/test-suite/lib/simpletest/cookies.php
  226. +0 −163 vendor/swift/test-suite/lib/simpletest/default_reporter.php
  227. +0 −96 vendor/swift/test-suite/lib/simpletest/detached.php
  228. +0 −359 vendor/swift/test-suite/lib/simpletest/dumper.php
  229. +0 −307 vendor/swift/test-suite/lib/simpletest/eclipse.php
  230. +0 −552 vendor/swift/test-suite/lib/simpletest/encoding.php
  231. +0 −257 vendor/swift/test-suite/lib/simpletest/errors.php
  232. +0 −198 vendor/swift/test-suite/lib/simpletest/exceptions.php
  233. +0 −901 vendor/swift/test-suite/lib/simpletest/expectation.php
  234. +0 −355 vendor/swift/test-suite/lib/simpletest/form.php
  235. +0 −592 vendor/swift/test-suite/lib/simpletest/frames.php
  236. +0 −628 vendor/swift/test-suite/lib/simpletest/http.php
  237. +0 −139 vendor/swift/test-suite/lib/simpletest/invoker.php
  238. +0 −1,630 vendor/swift/test-suite/lib/simpletest/mock_objects.php
Sorry, we could not display the entire diff because too many files (707) changed.
View
4 .gitignore
@@ -11,4 +11,6 @@
/data/*.db
/data/build/*/
/nbproject
-/docblox.dist.xml
+/docblox.xml
+/phpdoc.xml
+/vendor/
View
17 README.md
@@ -7,7 +7,8 @@ php projects. It is based on [Silex][1], a PHP micro framework.
CIPS supports projects hosted in a Subversion or Git repository.
Currently CIPS supports tests which return a non-zero exit code when tests do
-not pass as well as checkstyle results (like PHP Codesniffer).
+not pass, checkstyle results (like PHP Codesniffer), code coverage in clover
+format (as provided by PHPUnit) as well as a link to the project documentation.
CIPS works with PHP 5.3.2 or later.
@@ -86,6 +87,20 @@ Because the report file in the example is generated with a relative path, there
is a problem in cause the file does not exist. In this case it will not be
generated, therefore you have to create it manually before the first build.
+### Project Documentation
+
+You can set a link to the documentation of your project in
+``config/projects.php``.
+
+You can set the link like in the following example:
+
+```php
+<?php
+
+$your_project->setDocumentationLink('http://link/to/your/documentation');
+```
+You can create your documentation as a post build command in your project.
+
## License
CIPS is licensed under the MIT license.
View
2  cips
@@ -3,4 +3,4 @@
$app = require __DIR__.'/src/bootstrap.php';
$console = require __DIR__.'/src/console.php';
-$console->run();
+$console->run();
View
15 composer.json
@@ -0,0 +1,15 @@
+{
+ "minimum-stability": "dev",
+ "require": {
+ "silex/silex": "1.0.*",
+ "monolog/monolog": "1.0.*",
+ "twig/twig": ">=1.8,<2.0-dev",
+ "twig/extensions": "1.0.x-dev"
+ },
+ "autoload": {
+ "psr-0": {
+ "Cips": "src/",
+ "Symfony": "vendor/"
+ }
+ }
+}
View
503 composer.lock
@@ -0,0 +1,503 @@
+{
+ "hash": "c85f74e645c67d1cab90135131d6420d",
+ "packages": [
+ {
+ "name": "monolog/monolog",
+ "version": "1.0.2",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Seldaek/monolog",
+ "reference": "1.0.2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://github.com/Seldaek/monolog/zipball/1.0.2",
+ "reference": "1.0.2",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "time": "2011-10-24 02:39:02",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "Monolog": "src/"
+ }
+ },
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Jordi Boggiano",
+ "email": "j.boggiano@seld.be",
+ "homepage": "http://seld.be",
+ "role": "Developer"
+ }
+ ],
+ "description": "Logging for PHP 5.3",
+ "homepage": "http://github.com/Seldaek/monolog",
+ "keywords": [
+ "log",
+ "logging"
+ ]
+ },
+ {
+ "name": "pimple/pimple",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "git://github.com/fabpot/Pimple.git",
+ "reference": "b9f27b8dc18c08f00627dec02359b46a24791dc3"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://github.com/fabpot/Pimple/zipball/b9f27b8dc18c08f00627dec02359b46a24791dc3",
+ "reference": "b9f27b8dc18c08f00627dec02359b46a24791dc3",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "time": "1347278988",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "installation-source": "source",
+ "autoload": {
+ "psr-0": {
+ "Pimple": "lib/"
+ }
+ },
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "Pimple is a simple Dependency Injection Container for PHP 5.3",
+ "homepage": "http://pimple.sensiolabs.org",
+ "keywords": [
+ "dependency injection",
+ "container"
+ ]
+ },
+ {
+ "name": "silex/silex",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "git://github.com/fabpot/Silex.git",
+ "reference": "ffb53a4979b731d08dde6c7b455a9374a9ddd804"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://github.com/fabpot/Silex/zipball/ffb53a4979b731d08dde6c7b455a9374a9ddd804",
+ "reference": "ffb53a4979b731d08dde6c7b455a9374a9ddd804",
+ "shasum": ""
+ },
+ "require": {
+ "symfony/event-dispatcher": "2.1.*",
+ "symfony/http-foundation": "2.1.*",
+ "symfony/http-kernel": "2.1.*",
+ "symfony/routing": "2.1.*",
+ "php": ">=5.3.3",
+ "pimple/pimple": "1.*"
+ },
+ "require-dev": {
+ "symfony/form": "2.1.*",
+ "symfony/translation": "2.1.*",
+ "symfony/twig-bridge": "2.1.*",
+ "symfony/validator": "2.1.*",
+ "symfony/monolog-bridge": "2.1.*",
+ "symfony/browser-kit": "2.1.*",
+ "symfony/css-selector": "2.1.*",
+ "symfony/finder": "2.1.*",
+ "symfony/process": "2.1.*",
+ "symfony/security": "2.1.*",
+ "monolog/monolog": ">=1.0.0,<1.2-dev",
+ "symfony/config": "2.1.*",
+ "symfony/locale": "2.1.*",
+ "twig/twig": ">=1.8.0,<2.0-dev",
+ "swiftmailer/swiftmailer": "4.2.*",
+ "doctrine/dbal": ">=2.2.0,<2.4.0-dev"
+ },
+ "suggest": {
+ "symfony/browser-kit": "2.1.*",
+ "symfony/css-selector": "2.1.*",
+ "symfony/dom-crawler": "2.1.*"
+ },
+ "time": "1350048193",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "installation-source": "source",
+ "autoload": {
+ "psr-0": {
+ "Silex": "src/"
+ }
+ },
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Igor Wiedler",
+ "email": "igor@wiedler.ch",
+ "homepage": "http://wiedler.ch/igor/"
+ }
+ ],
+ "description": "The PHP micro-framework based on the Symfony2 Components",
+ "homepage": "http://silex.sensiolabs.org",
+ "keywords": [
+ "microframework"
+ ]
+ },
+ {
+ "name": "symfony/event-dispatcher",
+ "version": "2.1.x-dev",
+ "target-dir": "Symfony/Component/EventDispatcher",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/EventDispatcher",
+ "reference": "fb273317c0505ba657aa3d727530d36ae671fb82"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://github.com/symfony/EventDispatcher/zipball/fb273317c0505ba657aa3d727530d36ae671fb82",
+ "reference": "fb273317c0505ba657aa3d727530d36ae671fb82",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "symfony/dependency-injection": "2.1.*"
+ },
+ "suggest": {
+ "symfony/dependency-injection": "2.1.*",
+ "symfony/http-kernel": "2.1.*"
+ },
+ "time": "1349363877",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.1-dev"
+ }
+ },
+ "installation-source": "source",
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\EventDispatcher": ""
+ }
+ },
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony EventDispatcher Component",
+ "homepage": "http://symfony.com"
+ },
+ {
+ "name": "symfony/http-foundation",
+ "version": "2.1.x-dev",
+ "target-dir": "Symfony/Component/HttpFoundation",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/HttpFoundation",
+ "reference": "6a6185c9458e7c29447cd0579b9be647aea95dd1"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://github.com/symfony/HttpFoundation/zipball/6a6185c9458e7c29447cd0579b9be647aea95dd1",
+ "reference": "6a6185c9458e7c29447cd0579b9be647aea95dd1",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "time": "1350594961",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.1-dev"
+ }
+ },
+ "installation-source": "source",
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\HttpFoundation": "",
+ "SessionHandlerInterface": "Symfony/Component/HttpFoundation/Resources/stubs"
+ }
+ },
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony HttpFoundation Component",
+ "homepage": "http://symfony.com"
+ },
+ {
+ "name": "symfony/http-kernel",
+ "version": "2.1.x-dev",
+ "target-dir": "Symfony/Component/HttpKernel",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/HttpKernel",
+ "reference": "607aae40607abf459ab6be074258ec41323c4fa6"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://github.com/symfony/HttpKernel/zipball/607aae40607abf459ab6be074258ec41323c4fa6",
+ "reference": "607aae40607abf459ab6be074258ec41323c4fa6",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3",
+ "symfony/event-dispatcher": "2.1.*",
+ "symfony/http-foundation": "2.1.*"
+ },
+ "require-dev": {
+ "symfony/browser-kit": "2.1.*",
+ "symfony/class-loader": "2.1.*",
+ "symfony/config": "2.1.*",
+ "symfony/console": "2.1.*",
+ "symfony/dependency-injection": "2.1.*",
+ "symfony/finder": "2.1.*",
+ "symfony/process": "2.1.*",
+ "symfony/routing": "2.1.*"
+ },
+ "suggest": {
+ "symfony/browser-kit": "2.1.*",
+ "symfony/class-loader": "2.1.*",
+ "symfony/config": "2.1.*",
+ "symfony/console": "2.1.*",
+ "symfony/dependency-injection": "2.1.*",
+ "symfony/finder": "2.1.*"
+ },
+ "time": "1350122670",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.1-dev"
+ }
+ },
+ "installation-source": "source",
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\HttpKernel": ""
+ }
+ },
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony HttpKernel Component",
+ "homepage": "http://symfony.com"
+ },
+ {
+ "name": "symfony/routing",
+ "version": "2.1.x-dev",
+ "target-dir": "Symfony/Component/Routing",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/symfony/Routing",
+ "reference": "6392f89975bd2b3ef4facbb5ef48143d035a9ff2"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://github.com/symfony/Routing/zipball/6392f89975bd2b3ef4facbb5ef48143d035a9ff2",
+ "reference": "6392f89975bd2b3ef4facbb5ef48143d035a9ff2",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "symfony/config": "2.1.*",
+ "symfony/yaml": "2.1.*",
+ "symfony/http-kernel": "2.1.*",
+ "doctrine/common": ">=2.2,<2.4-dev"
+ },
+ "suggest": {
+ "doctrine/common": ">=2.2,<2.4-dev",
+ "symfony/config": "2.1.*",
+ "symfony/yaml": "2.1.*"
+ },
+ "time": "1350203264",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "2.1-dev"
+ }
+ },
+ "installation-source": "source",
+ "autoload": {
+ "psr-0": {
+ "Symfony\\Component\\Routing": ""
+ }
+ },
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Symfony Community",
+ "homepage": "http://symfony.com/contributors"
+ }
+ ],
+ "description": "Symfony Routing Component",
+ "homepage": "http://symfony.com"
+ },
+ {
+ "name": "twig/extensions",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/fabpot/Twig-extensions",
+ "reference": "dcdff02fbac1282e6b8f4d0558cc7e9580105688"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://github.com/fabpot/Twig-extensions/zipball/dcdff02fbac1282e6b8f4d0558cc7e9580105688",
+ "reference": "dcdff02fbac1282e6b8f4d0558cc7e9580105688",
+ "shasum": ""
+ },
+ "require": {
+ "twig/twig": "1.*"
+ },
+ "time": "1349889206",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.0.x-dev"
+ }
+ },
+ "installation-source": "source",
+ "autoload": {
+ "psr-0": {
+ "Twig_Extensions_": "lib/"
+ }
+ },
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ }
+ ],
+ "description": "Common additional features for Twig that do not directly belong in core",
+ "homepage": "https://github.com/fabpot/Twig-extensions",
+ "keywords": [
+ "debug",
+ "i18n",
+ "text"
+ ]
+ },
+ {
+ "name": "twig/twig",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "git://github.com/fabpot/Twig.git",
+ "reference": "3031fe6b95f7a1791ab89beb4fe8c8e469582b78"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://github.com/fabpot/Twig/zipball/3031fe6b95f7a1791ab89beb4fe8c8e469582b78",
+ "reference": "3031fe6b95f7a1791ab89beb4fe8c8e469582b78",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.2.4"
+ },
+ "time": "1350629283",
+ "type": "library",
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.10-dev"
+ }
+ },
+ "installation-source": "source",
+ "autoload": {
+ "psr-0": {
+ "Twig_": "lib/"
+ }
+ },
+ "license": [
+ "BSD-3"
+ ],
+ "authors": [
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
+ },
+ {
+ "name": "Armin Ronacher",
+ "email": "armin.ronacher@active-4.com"
+ }
+ ],
+ "description": "Twig, the flexible, fast, and secure template language for PHP",
+ "homepage": "http://twig.sensiolabs.org",
+ "keywords": [
+ "templating"
+ ]
+ }
+ ],
+ "packages-dev": null,
+ "aliases": [
+
+ ],
+ "minimum-stability": "dev",
+ "stability-flags": {
+ "twig/extensions": 20
+ }
+}
View
1  data/postReceive.txt
@@ -0,0 +1 @@
+{ "before": "5aef35982fb2d34e9d9d4502f6ede1072793222d", "repository": { "url": "http://github.com/defunkt/github", "name": "github", "description": "You're lookin' at it.", "watchers": 5, "forks": 2, "private": 1, "owner": { "email": "chris@ozmm.org", "name": "defunkt" } }, "commits": [ { "id": "41a212ee83ca127e3c8cf465891ab7216a705f59", "url": "http://github.com/defunkt/github/commit/41a212ee83ca127e3c8cf465891ab7216a705f59", "author": { "email": "chris@ozmm.org", "name": "Chris Wanstrath" }, "message": "okay i give in", "timestamp": "2008-02-15T14:57:17-08:00", "added": ["filepath.rb"] }, { "id": "de8251ff97ee194a289832576287d6f8ad74e3d0", "url": "http://github.com/defunkt/github/commit/de8251ff97ee194a289832576287d6f8ad74e3d0", "author": { "email": "chris@ozmm.org", "name": "Chris Wanstrath" }, "message": "update pricing a tad", "timestamp": "2008-02-15T14:36:34-08:00" } ], "after": "de8251ff97ee194a289832576287d6f8ad74e3d0", "ref": "refs/heads/master" }
View
14 phpdoc.dist.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<phpdoc>
+ <title><![CDATA[CIPS]]></title>
+ <parser>
+ <markers>
+ <item>TODO</item>
+ <item>FIXME</item>
+ </markers>
+ </parser>
+ <files>
+ <directory>src</directory>
+ <ignore>*Test*</ignore>
+ </files>
+</phpdoc>
View
175 src/Cips/Build.php
@@ -0,0 +1,175 @@
+<?php
+/**
+ * File for the Build Class.
+ *
+ * PHP Version 5.3
+ *
+ * @category Build
+ * @package CIPS\Build
+ * @author Alfred Danda <alfred.danda@gmail.com>
+ * @license MIT License
+ * @link Build
+ */
+
+namespace Cips;
+
+/**
+ * A class that represents a single Build of a Project.
+ *
+ * @category Build
+ * @package CIPS\Build
+ * @author Alfred Danda <alfred.danda@gmail.com>
+ * @license MIT License
+ * @link Build
+ */
+class Build
+{
+ /**
+ * The number of the build.
+ * @var int
+ */
+ private $_number;
+
+ /**
+ * The console output of the Build.
+ * @var string
+ */
+ private $_output = '';
+
+ /**
+ * The success status of the Build.
+ * @var bool
+ */
+ private $_success;
+
+ /**
+ * The date and time of the Build.
+ */
+ private $_date;
+
+ /**
+ * Constructor.
+ *
+ * @param array $build An array with the Build values
+ */
+ public function __construct($build)
+ {
+ $this->_number = $build['build'];
+ $this->_output = $build['output'];
+ $this->_success = $build['success'];
+ $this->_date = $build['build_date'];
+ }
+
+ /**
+ * Setter for the number of the Build.
+ *
+ * @param int $number The number of the Build
+ *
+ * @return Build The Object itself
+ */
+ public function setNumber($number)
+ {
+ $this->_number = $number;
+ return $this;
+ }
+
+ /**
+ * Getter for the number of the Build.
+ *
+ * @return int The number of the Build
+ */
+ public function getNumber()
+ {
+ return $this->_number;
+ }
+
+ /**
+ * Setter for the output of the Build.
+ *
+ * @param string $output The output of the Build
+ *
+ * @return Build The Object itself
+ */
+ public function setOutput($output)
+ {
+ $this->_output = $output;
+ return $this;
+ }
+
+ /**
+ * Getter for the output of the Build.
+ *
+ * @return string The output of the Build
+ */
+ public function getOutput()
+ {
+ return $this->_output;
+ }
+
+ /**
+ * Setter for the success of the Build.
+ *
+ * @param bool $success The success of the Build
+ *
+ * @return Build The Object itself
+ */
+ public function setSuccess($success)
+ {
+ $this->_success = $success;
+ return $this;
+ }
+
+ /**
+ * Getter for the success of the Build.
+ *
+ * @return bool The success of the Build
+ */
+ public function getSuccess()
+ {
+ return $this->_success;
+ }
+
+ /**
+ * Setter for the date of the Build.
+ *
+ * @param string $date The date of the Build
+ *
+ * @return Build The Object itself
+ */
+ public function setDate($date)
+ {
+ $this->_date = $date;
+ return $this;
+ }
+
+ /**
+ * Getter for the date of the Build.
+ *
+ * @return string The date of the Build
+ */
+ public function getDate()
+ {
+ return $this->_date;
+ }
+
+ /**
+ * Changes the ANSI-Colors of a CLI-Output to a HTML-String.
+ *
+ * @return string A HTML-String
+ */
+ public function getOutputAsHtml()
+ {
+ $converts = array(
+ "[30;42m" => "<span class='green_bg'>",
+ "[30;43m" => "<span class='yellow_bg'>",
+ "[41;37m" => "<span class='red_bg'>",
+ "[37;41m" => "<span class='red_bg'>",
+ "[33;1m" => "<span class='yellow_fg'>",
+ "[0m" => "</span>",
+ "[2K" => "",
+ "\n" => "<br/>"
+ );
+ $html = str_replace(array_keys($converts), $converts, $this->_output);
+ return $html;
+ }
+}
View
15 src/Cips/Projects/GitProject.php
@@ -4,7 +4,7 @@
* in a Git Repository
*
* PHP Version 5.3
- *
+ *
* @category Project
* @package CIPS\Projects
* @author Alfred Danda <alfred.danda@gmail.com>
@@ -31,7 +31,7 @@ class GitProject extends Project
* Checks out the Source to the data.path
*
* @param string $data_path The path to the build-Directory
- *
+ *
* @return GitProject The Object itself
*/
public function checkout($data_path)
@@ -48,6 +48,7 @@ public function checkout($data_path)
$process = new Process($cmd);
$process->run();
+ echo $process->getOutput();
} else {
return $this->update($data_path);
}
@@ -59,17 +60,23 @@ public function checkout($data_path)
* Updates the Source to the data.path
*
* @param string $data_path The path to the build-Directory
- *
+ *
* @return GitProject The Object itself
*/
public function update($data_path)
{
if (is_dir($data_path.'/'.$this->getSlug())) {
- $cmd = 'git pull';
+ $cmd = 'git clean --force';
$dir = $data_path.'/'.$this->getSlug().'/source';
$process = new Process($cmd, $dir);
$process->run();
+echo $process->getOutput();
+ $cmd = 'git pull';
+ $process = new Process($cmd, $dir);
+ $process->run();
+
+ echo $process->getOutput();
}
return $this;
View
58 src/Cips/Projects/Project.php
@@ -13,6 +13,7 @@
namespace Cips\Projects;
+use Cips\Build;
use Symfony\Component\Process\Process;
/**
@@ -361,14 +362,14 @@ public function getLastBuild($db)
);
$stmt->bindValue(':slug', $this->getSlug(), SQLITE3_TEXT);
- if (FALSE !== $result = $stmt->execute()) {
- if (FALSE !== $result = $result->fetchArray(\SQLITE3_ASSOC)) {
+ if (false !== $result = $stmt->execute()) {
+ if (false !== $result = $result->fetchArray(\SQLITE3_ASSOC)) {
return $result;
}
}
}
- return FALSE;
+ return false;
}
/**
@@ -393,9 +394,9 @@ public function getBuilds($db, $num_of_builds, $offset = 0)
$stmt->bindValue(':offset', $offset, SQLITE3_TEXT);
$stmt->bindValue(':num', $num_of_builds, SQLITE3_TEXT);
- if (FALSE !== $result = $stmt->execute()) {
+ if (false !== $result = $stmt->execute()) {
while ($build = $result->fetchArray(\SQLITE3_ASSOC)) {
- $builds[] = $build;
+ $builds[] = new Build($build);
}
}
}
@@ -425,7 +426,7 @@ public function getTestresultChartData($db, $num_of_builds)
$failures_data = '[';
$errors_data = '[';
- if (FALSE !== $result = $stmt->execute()) {
+ if (false !== $result = $stmt->execute()) {
while ($row = $result->fetchArray(\SQLITE3_ASSOC)) {
$tests_data .= '['.$row['build'].','.$row['tests'].'],';
$assertions_data .= '['.$row['build'].','.$row['assertions'].'],';
@@ -462,7 +463,7 @@ public function getCoverageChartData($db, $num_of_builds)
$data = '[[';
- if (FALSE !== $result = $stmt->execute()) {
+ if (false !== $result = $stmt->execute()) {
while ($row = $result->fetchArray(\SQLITE3_ASSOC)) {
$data .= '['.$row['build'].',';
$data .= ($row['coveredelements']) / ($row['elements'] / 100);
@@ -493,7 +494,7 @@ public function getCheckstyleChartData($db, $num_of_builds)
$data = '[[';
- if (FALSE !== $result = $stmt->execute()) {
+ if (false !== $result = $stmt->execute()) {
while ($row = $result->fetchArray(\SQLITE3_ASSOC)) {
$data .= '['.$row['build'].','.$row['errors'].'],';
}
@@ -511,7 +512,7 @@ public function getCheckstyleChartData($db, $num_of_builds)
*/
public function build($app)
{
- $success = TRUE;
+ $success = true;
$output = '';
foreach ($this->getPreBuildCommands() as $cmd) {
@@ -572,6 +573,11 @@ public function build($app)
$output .= $this->generateComposedOutput($cmd, $process->getOutput());
}
+ $process = new Process(
+ 'chmod 777 *', $app['build.path'].'/'.$this->getSlug().'/reports'
+ );
+ $process->run();
+
if (!$success) {
$this->getNotifier()->notify($this, $output, $app);
}
@@ -592,7 +598,7 @@ public function build($app)
$stmt->bindValue(':output', $output, SQLITE3_TEXT);
$stmt->bindValue(':date', date('Y-m-d H:i:s'), SQLITE3_TEXT);
- if (FALSE === $stmt->execute()) {
+ if (false === $stmt->execute()) {
throw new \RuntimeException(
sprintf('Unable to save project "%s".', $this->getName())
);
@@ -632,7 +638,7 @@ public function build($app)
$stmt->bindValue(':failures', $failures, SQLITE3_INTEGER);
$stmt->bindValue(':errors', $errors, SQLITE3_INTEGER);
- if (FALSE === $stmt->execute()) {
+ if (false === $stmt->execute()) {
throw new \RuntimeException(
sprintf('Unable to save project "%s".', $this->getName())
);
@@ -696,7 +702,7 @@ public function build($app)
SQLITE3_INTEGER
);
- if (FALSE === $stmt->execute()) {
+ if (false === $stmt->execute()) {
throw new \RuntimeException(
sprintf('Unable to save project "%s".', $this->getName())
);
@@ -730,7 +736,7 @@ public function build($app)
);
$stmt->bindValue(':errors', $errors, SQLITE3_TEXT);
- if (FALSE === $stmt->execute()) {
+ if (false === $stmt->execute()) {
throw new \RuntimeException(
sprintf('Unable to save project "%s".', $this->getName())
);
@@ -750,14 +756,36 @@ public function build($app)
*/
protected function generateComposedOutput($cmd, $output)
{
- $composed_output = str_repeat('*', 100)."\n\r\n\r";
- $composed_output .= '$ '.$cmd."\n\r\n\r\n\r";
+ $composed_output = '$ '.$cmd."\n\r\n\r";
$composed_output .= $output."\n\r\n\r";
return $composed_output;
}
/**
+ * Changes the ANSI-Colors of a CLI-Output to a HTML-String.
+ *
+ * @param string $ansi The ANSI-String to convert
+ *
+ * @return string A HTML-String
+ */
+ public function consoleOutputToHtml($ansi)
+ {
+ $converts = array(
+ "[30;42m" => "<span class='green_bg'>",
+ "[30;43m" => "<span class='yellow_bg'>",
+ "[41;37m" => "<span class='red_bg'>",
+ "[37;41m" => "<span class='red_bg'>",
+ "[33;1m" => "<span class='yellow_fg'>",
+ "[0m" => "</span>",
+ "[2K" => "",
+ "\n" => "<br/>"
+ );
+ $html = str_replace(array_keys($converts), $converts, $ansi);
+ return $html;
+ }
+
+ /**
* Function which checks out the Source Code to the given path
*
* @param string $data_path The path to the root of the Source Code
View
278 src/app.php
@@ -12,159 +12,181 @@
* @link Project
*/
use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\Process\Process;
+use Symfony\Component\HttpFoundation\Response;
$app->error(function(Exception $e) use ($app)
- {
- var_dump($e);
- return $app->redirect('/');
- });
+ {
+ return new Response(
+ $app['twig']->render('error.html.twig', array(
+ 'error' => $e
+ )),
+ 500
+ );
+ });
$app->get('/', function() use ($app)
- {
- $projects = require __DIR__ . '/../config/projects.php';
- return $app['twig']->render('index.html.twig', array(
- 'projects' => $projects,
- 'db' => $app['db']
- ));
- });
+ {
+ $projects = require __DIR__ . '/../config/projects.php';
+ return $app['twig']->render('index.html.twig', array(
+ 'projects' => $projects,
+ 'db' => $app['db']
+ ));
+ });
$app->get('/project/{slug}', function($slug) use ($app)
- {
- $projects = require __DIR__ . '/../config/projects.php';
- $project = $projects[$slug];
- return $app['twig']->render('project.html.twig', array(
- 'project' => $project,
- 'has_checkstyle' => file_exists(
- $app['data.path'] . '/build/' . $project->getSlug() . '/reports/checkstyle.xml'
- ),
- 'has_testresult' => file_exists(
- $app['data.path'] . '/build/' . $project->getSlug() . '/reports/testresult.xml'
- ),
- 'has_coverage' => file_exists(
- $app['data.path'] . '/build/' . $project->getSlug() . '/reports/coverage.xml'
- ),
- 'db' => $app['db']
- ));
- });
+ {
+ $projects = require __DIR__ . '/../config/projects.php';
+ $project = $projects[$slug];
+ return $app['twig']->render('project.html.twig', array(
+ 'project' => $project,
+ 'has_checkstyle' => file_exists(
+ $app['data.path'] . '/build/' . $project->getSlug() . '/reports/checkstyle.xml'
+ ),
+ 'has_testresult' => file_exists(
+ $app['data.path'] . '/build/' . $project->getSlug() . '/reports/testresult.xml'
+ ),
+ 'has_coverage' => file_exists(
+ $app['data.path'] . '/build/' . $project->getSlug() . '/reports/coverage.xml'
+ ),
+ 'db' => $app['db']
+ ));
+ });
$app->get('/checkstyle/{slug}', function($slug) use ($app)
- {
- $projects = require __DIR__ . '/../config/projects.php';
- $project = $projects[$slug];
- $checkstyle = simplexml_load_file(
- $app['data.path'] . '/build/' . $project->getSlug() . '/reports/checkstyle.xml'
- );
- $errors = 0;
- foreach ( $checkstyle as $file )
- {
- $errors += count($file->error);
- }
- return $app['twig']->render('checkstyle.html.twig', array(
- 'project' => $project,
- 'checkstyle' => $checkstyle,
- 'errors' => $errors,
- 'checkstyle_time' => date(
- 'd.m.Y H:i:s', filemtime($app['data.path'] . '/build/'
- . $project->getSlug() . '/reports/checkstyle.xml')
- ),
- 'build_path' => $app['data.path'] . '/build/'
- . $project->getSlug() . '/source/'
- ));
- });
+ {
+ $projects = require __DIR__ . '/../config/projects.php';
+ $project = $projects[$slug];
+ $checkstyle = simplexml_load_file(
+ $app['data.path'] . '/build/' . $project->getSlug() . '/reports/checkstyle.xml'
+ );
+ $errors = 0;
+ foreach ($checkstyle as $file)
+ {
+ $errors += count($file->error);
+ }
+ return $app['twig']->render('checkstyle.html.twig', array(
+ 'project' => $project,
+ 'checkstyle' => $checkstyle,
+ 'errors' => $errors,
+ 'checkstyle_time' => date(
+ 'd.m.Y H:i:s', filemtime($app['data.path'] . '/build/'
+ . $project->getSlug() . '/reports/checkstyle.xml')
+ ),
+ 'build_path' => $app['data.path'] . '/build/'
+ . $project->getSlug() . '/source/'
+ ));
+ });
$app->get('/loadbuilds/{slug}/{limit}/{offset}', function($slug, $limit, $offset) use ($app)
- {
- $projects = require __DIR__ . '/../config/projects.php';
- $project = $projects[$slug];
- $builds = $project->getBuilds($app['db'], $limit, $offset);
-
- return $app['twig']->render('builds.html.twig', array(
- 'builds' => $builds
- ));
- }
+ {
+ $projects = require __DIR__ . '/../config/projects.php';
+ $project = $projects[$slug];
+ $builds = $project->getBuilds($app['db'], $limit, $offset);
+
+ return $app['twig']->render('builds.html.twig', array(
+ 'builds' => $builds
+ ));
+ }
);
$app->get('/testresult/{slug}', function($slug) use ($app)
- {
- $projects = require __DIR__ . '/../config/projects.php';
- $project = $projects[$slug];
- $testsuites = simplexml_load_file(
- $app['data.path'] . '/build/' . $project->getSlug() . '/reports/testresult.xml'
- );
-
- return $app['twig']->render('testresult.html.twig', array(
- 'project' => $project,
- 'testsuites' => $testsuites,
- 'build_path' => $app['data.path'] . '/build/'
- . $project->getSlug() . '/source/'
- )
- );
- });
+ {
+ $projects = require __DIR__ . '/../config/projects.php';
+ $project = $projects[$slug];
+ $testsuites = simplexml_load_file(
+ $app['data.path'] . '/build/' . $project->getSlug() . '/reports/testresult.xml'
+ );
+
+ return $app['twig']->render('testresult.html.twig', array(
+ 'project' => $project,
+ 'testsuites' => $testsuites,
+ 'build_path' => $app['data.path'] . '/build/'
+ . $project->getSlug() . '/source/'
+ )
+ );
+ });
$app->get('/coverage/{slug}', function($slug) use ($app)
- {
- $projects = require __DIR__ . '/../config/projects.php';
- $project = $projects[$slug];
- $coverage = simplexml_load_file(
- $app['data.path'] . '/build/' . $project->getSlug() . '/reports/coverage.xml'
- );
-
- return $app['twig']->render('coverage.html.twig', array(
- 'project' => $project,
- 'coverage' => $coverage,
- 'build_path' => $app['data.path'] . '/build/'
- . $project->getSlug() . '/source/'
- )
- );
- });
+ {
+ $projects = require __DIR__ . '/../config/projects.php';
+ $project = $projects[$slug];
+ $coverage = simplexml_load_file(
+ $app['data.path'] . '/build/' . $project->getSlug() . '/reports/coverage.xml'
+ );
+
+ return $app['twig']->render('coverage.html.twig', array(
+ 'project' => $project,
+ 'coverage' => $coverage,
+ 'build_path' => $app['data.path'] . '/build/'
+ . $project->getSlug() . '/source/'
+ )
+ );
+ });
$app->post('/coverage/details', function(Request $request) use ($app)
-{
- $projects = require __DIR__.'/../config/projects.php';
- $project = $projects[$request->get('slug')];
- $path = $request->get('path');
- $coverage = simplexml_load_file(
- $app['data.path'].'/build/'.$project->getSlug().'/reports/coverage.xml'
- );
-
- $file = file($path);
- if ($file === FALSE) {
+ {
+ $projects = require __DIR__ . '/../config/projects.php';
+ $project = $projects[$request->get('slug')];
+ $path = $request->get('path');
+ $coverage = simplexml_load_file(
+ $app['data.path'] . '/build/' . $project->getSlug() . '/reports/coverage.xml'
+ );
+
+ $file = file($path);
+ if ($file === false)
+ {
return '<h1>Error reading file!</h1>';
- }
+ }
- foreach ($coverage->project->package as $package) {
- foreach ($package->file as $row) {
- if ($row['name'] == $path) {
- break 2;
- }
+ foreach ($coverage->project->package as $package)
+ {
+ foreach ($package->file as $row)
+ {
+ if ($row['name'] == $path)
+ {
+ break 2;
+ }
}
- }
+ }
- if (!isset($row)) {
+ if (!isset($row))
+ {
return '<h1>Error reading file!</h1>';
- }
+ }
- $rows = array();
- foreach ($row->line as $line) {
+ $rows = array();
+ foreach ($row->line as $line)
+ {
$rows[$line['num']->__toString()] = $line['count']->__toString();
- }
+ }
- return $app['twig']->render('coverage_details.html.twig', array(
- 'file' => $file,
- 'rows' => $rows
- )
- );
-});
+ return $app['twig']->render('coverage_details.html.twig', array(
+ 'file' => $file,
+ 'rows' => $rows
+ )
+ );
+ });
$app->get('/build/{slug}', function($slug) use ($app)
-{
- $projects = require __DIR__.'/../config/projects.php';
- $project = $projects[$slug];
- $project->build($app);
-
- return $app['twig']->render('builds.html.twig', array(
- 'builds' => array($project->getLastBuild($app['db']))
- ));
-});
+ {
+ $projects = require __DIR__ . '/../config/projects.php';
+ $project = $projects[$slug];
+ $project->checkout($app['build.path'])
+ ->build($app);
+
+ return $app['twig']->render('builds.html.twig', array(
+ 'builds' => array(new Cips\Build($project->getLastBuild($app['db'])))
+ ));
+ });
+
+$app->post('/pushhook', function(Request $request) use ($app)
+ {
+ $payload = $request->get('payload');
+ $myFile = $app['data.path'] . "/postReceive.txt";
+ $fh = fopen($myFile, 'w') or die("can't open file");
+ $stringData = $payload . "\n";
+ fwrite($fh, $stringData);
+ fclose($fh);
+ return 'Ok';
+ });
View
33 src/bootstrap.php
@@ -11,29 +11,26 @@
* @link Project
*/
-require_once __DIR__.'/../vendor/silex.phar';
+require_once __DIR__ . '/../vendor/autoload.php';
+//require_once __DIR__.'/../vendor/silex.phar';
// create new Application
$app = new Silex\Application();
// register Namespaces
-$app['autoloader']->registerNamespaces(
- array(
- 'Cips' => __DIR__,
- 'Symfony' => __DIR__.'/../vendor'
- )
-);
+//$app['autoloader']->registerNamespaces(
+// array(
+// 'Cips' => __DIR__,
+// 'Symfony' => __DIR__.'/../vendor'
+// )
+//);
// register Extensions for the Application
-$app->register(
- new Silex\Extension\TwigExtension(), array(
- 'twig.path' => __DIR__.'/../views',
- 'twig.class_path' => __DIR__.'/../vendor/twig/lib',
- )
-);
+$app->register(new Silex\Provider\TwigServiceProvider(), array(
+ 'twig.path' => __DIR__.'/../views',
+));
-$app['swiftmailer.class_path'] = __DIR__.'/../vendor/swift/lib/classes';
-$app->register(new Silex\Extension\SwiftmailerExtension(), array());
+$app->register(new Silex\Provider\SwiftmailerServiceProvider(), array());
$app['data.path'] = realpath(__DIR__.'/../data');
$app['build.path'] = $app['data.path'].'/build';
@@ -91,9 +88,9 @@ classes INT,
$app['db'] = $app->share(function () use ($app)
{
- $chmod = FALSE;
+ $chmod = false;
if (!file_exists($app['db.path'])) {
- $chmod = TRUE;
+ $chmod = true;
}
try {
$db = new \SQLite3($app['db.path']);
@@ -103,7 +100,7 @@ classes INT,
chmod($app['db.path'], 0777);
}
} catch (Exception $e) {
- return NULL;
+ return null;
}
return $db;
View
8 src/console.php
@@ -222,7 +222,7 @@
// Delete builds
$stmt = $app['db']->prepare('DELETE FROM builds WHERE slug = :slug');
$stmt->bindValue(':slug', $slug, SQLITE3_TEXT);
- if (FALSE === $stmt->execute()) {
+ if (false === $stmt->execute()) {
throw new \RuntimeException(
sprintf('Unable to delete project "%s".', $this->getName())
);
@@ -233,7 +233,7 @@
'DELETE FROM builds_checkstyle WHERE slug = :slug'
);
$stmt->bindValue(':slug', $slug, SQLITE3_TEXT);
- if (FALSE === $stmt->execute()) {
+ if (false === $stmt->execute()) {
throw new \RuntimeException(
sprintf('Unable to delete project "%s".', $this->getName())
);
@@ -244,7 +244,7 @@
'DELETE FROM builds_coverage WHERE slug = :slug'
);
$stmt->bindValue(':slug', $slug, SQLITE3_TEXT);
- if (FALSE === $stmt->execute()) {
+ if (false === $stmt->execute()) {
throw new \RuntimeException(
sprintf('Unable to delete project "%s".', $this->getName())
);
@@ -255,7 +255,7 @@
'DELETE FROM builds_testresult WHERE slug = :slug'
);
$stmt->bindValue(':slug', $slug, SQLITE3_TEXT);
- if (FALSE === $stmt->execute()) {
+ if (false === $stmt->execute()) {
throw new \RuntimeException(
sprintf('Unable to delete project "%s".', $this->getName())
);
View
2  tests/phpunit.xml
@@ -2,7 +2,7 @@
<phpunit backupGlobals="false"
backupStaticAttributes="false"
- colors="false"
+ colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
View
6 tests/unit/GitProjectTest.php
@@ -19,13 +19,13 @@ public function testCheckout()
$result = $this->getMock('Process');
$result->expects($this->any())
->method('run')
- ->will($this->returnValue(TRUE));
+ ->will($this->returnValue(true));
$this->assertEquals($gitProject, $gitProject->checkout(''),
'GitProject::checkout() returns the object itself when the project '.
'does exist and the checkout is sucessfull');
- $gitProject->setSlug(uniqid('cips', TRUE));
+ $gitProject->setSlug(uniqid('cips', true));
$this->assertEquals($gitProject, $gitProject->checkout(sys_get_temp_dir()),
'GitProject::checkout() returns the object itself when the project '.
'does not exist and the checkout is sucessfull');
@@ -38,7 +38,7 @@ public function testUpdate()
$result = $this->getMock('Process');
$result->expects($this->any())
->method('run')
- ->will($this->returnValue(TRUE));
+ ->will($this->returnValue(true));
$this->assertEquals($gitProject, $gitProject->update(''),
'GitProject::update() returns the object itself when the project '.
View
70 tests/unit/ProjectTest.php
@@ -1,6 +1,7 @@
<?php
require_once __DIR__.'/../../src/Cips/Projects/Project.php';
+require_once __DIR__.'/../../src/Cips/Build.php';
require_once __DIR__.'/../stubs/DB.php';
/**
@@ -87,13 +88,13 @@ public function testGetLastBuild()
{
$svnProject = new Cips\Projects\SvnProject('test');
- $this->assertFalse($svnProject->getLastBuild(FALSE),
+ $this->assertfalse($svnProject->getLastBuild(false),
'SvnProject::getLastBuild() returns false when no DB is given');
$result = $this->getMock('myResult');
$result->expects($this->any())
->method('fetchArray')
- ->will($this->returnValue(FALSE));
+ ->will($this->returnValue(false));
$statement = $this->getMock('myStatement');
$statement->expects($this->any())
@@ -105,7 +106,7 @@ public function testGetLastBuild()
->method('prepare')
->will($this->returnValue($statement));
- $this->assertFalse($svnProject->getLastBuild($db),
+ $this->assertfalse($svnProject->getLastBuild($db),
'SvnProject::getLastBuild() returns false when no result is given '.
'from the DB');
@@ -117,14 +118,14 @@ public function testGetLastBuild()
$statement = $this->getMock('myStatement');
$statement->expects($this->any())
->method('execute')
- ->will($this->returnValue(FALSE));
+ ->will($this->returnValue(false));
$db = $this->getMock('myDb');
$db->expects($this->any())
->method('prepare')
->will($this->returnValue($statement));
- $this->assertFalse($svnProject->getLastBuild($db),
+ $this->assertfalse($svnProject->getLastBuild($db),
'SvnProject::getLastBuild() returns false when the Statement returns '.
'no Result');
@@ -151,13 +152,13 @@ public function testGetBuilds()
{
$svnProject = new Cips\Projects\SvnProject('test');
- $this->assertEquals(array(), $svnProject->getBuilds(FALSE, 20),
+ $this->assertEquals(array(), $svnProject->getBuilds(false, 20),
'SvnProject::getBuilds() returns an empty Array when no DB is given');
$result = $this->getMock('myResult');
$result->expects($this->any())
->method('fetchArray')
- ->will($this->returnValue(FALSE));
+ ->will($this->returnValue(false));
$statement = $this->getMock('myStatement');
$statement->expects($this->any())
@@ -181,7 +182,7 @@ public function testGetBuilds()
$statement = $this->getMock('myStatement');
$statement->expects($this->any())
->method('execute')
- ->will($this->returnValue(FALSE));
+ ->will($this->returnValue(false));
$db = $this->getMock('myDb');
$db->expects($this->any())
@@ -192,14 +193,33 @@ public function testGetBuilds()
'SvnProject::getBuilds() returns an empty Array when the Statement '.
'returns no Result');
+ $build1 = array(
+ 'build' => 1,
+ 'success' => true,
+ 'build_date' => '2010-12-12 12:12:12',
+ 'output' => 'SUCCESS'
+ );
+ $build2 = array(
+ 'build' => 2,
+ 'success' => false,
+ 'build_date' => '2010-12-13 12:12:12',
+ 'output' => 'FAILURE'
+ );
+ $build3 = array(
+ 'build' => 3,
+ 'success' => true,
+ 'build_date' => '2010-12-14 12:12:12',
+ 'output' => 'SUCCESS'
+ );
+
$result = $this->getMock('myResult');
$result->expects($this->any())
->method('fetchArray')