P Richards
2014-09-21 22:20:24 UTC
Hi All,
I'd like to draw people's attention to
https://github.com/mantisbt/mantisbt/pull/332 - as it's start of work to
implement a common build system that both travis and mantis developers can
use. As we add unit tests allowing mantis developers to easily create a
build locally and also show up code style issues should hopefully lead to
less churn in the source code (and make supporting different releases of
mantis easier).
I think the summary I put on the github PR hopefully covers most things so
far, so going to just paste it here rather than writing another wall of
text:
For a long while now, the build a developer can do,
and the build one can automate on travis-ci are too different things.
This is the start of a process to unify the build system, such that a
developer can run a local build before/without having to wait for
travis-ci or some other automation system to kick in.
The requirements for this to run at the moment is an installation of
either phing or composer.
Phing route:
Phing can be installed, if not already installed by running:
pear channel-discover pear.phing.info
pear install [--alldeps] phing/phing
going to the Mantis directory, and running phing then starts a build.
This build will download composer, download a standard version of
phpcodesniffer/phpunit, and it's own copy of phing and run a build based
on these versions. This ensures that local + travis etc versions are the
same
Composer Route:
php -r "readfile(' <https://getcomposer.org/installer');>
https://getcomposer.org/installer');" | php
composer install
A build can be run at this point by calling:
php vendor/bin/phing build
Note: at the moment, I've specified 'build' as a target here, as the
default option is to run a target called "buildsystem" at the moment,
which downloads all the dependencies
travis-ci.org build has been modified to include the process described
above so that a developers build and the build system build converge
towards being identical.
At the moment a 'build' consists of the following:
a) doing a quick lint check on PHP files for parse errors
b) Running some popular code metrics type utilities: phploc,pdepend
c) running phpcs with a custom ruleset which tries to follow mantis's rules
d) running phpunit tests
e) generating some api documentation
(atm, via phpdox, although should also generated via phpdoc2)
f) spit our a zip/tarball package of the build
Full build time is with codesniffer rules etc is around 2.5-3 minutes
locally
however, individual steps can be run:
For example:
phing phpcs will run codesniffer rules against code base.
phing phpunit will run php unit tests.
This is very much a first step - I suspect we will alter the tools,
add tools and commands etc, as we work out whats useful and what isn't.
For example, I've seen some phing build scripts that deal with creating
and merging between local branches/github PR's etc.
I'd like to draw people's attention to
https://github.com/mantisbt/mantisbt/pull/332 - as it's start of work to
implement a common build system that both travis and mantis developers can
use. As we add unit tests allowing mantis developers to easily create a
build locally and also show up code style issues should hopefully lead to
less churn in the source code (and make supporting different releases of
mantis easier).
I think the summary I put on the github PR hopefully covers most things so
far, so going to just paste it here rather than writing another wall of
text:
For a long while now, the build a developer can do,
and the build one can automate on travis-ci are too different things.
This is the start of a process to unify the build system, such that a
developer can run a local build before/without having to wait for
travis-ci or some other automation system to kick in.
The requirements for this to run at the moment is an installation of
either phing or composer.
Phing route:
Phing can be installed, if not already installed by running:
pear channel-discover pear.phing.info
pear install [--alldeps] phing/phing
going to the Mantis directory, and running phing then starts a build.
This build will download composer, download a standard version of
phpcodesniffer/phpunit, and it's own copy of phing and run a build based
on these versions. This ensures that local + travis etc versions are the
same
Composer Route:
php -r "readfile(' <https://getcomposer.org/installer');>
https://getcomposer.org/installer');" | php
composer install
A build can be run at this point by calling:
php vendor/bin/phing build
Note: at the moment, I've specified 'build' as a target here, as the
default option is to run a target called "buildsystem" at the moment,
which downloads all the dependencies
travis-ci.org build has been modified to include the process described
above so that a developers build and the build system build converge
towards being identical.
At the moment a 'build' consists of the following:
a) doing a quick lint check on PHP files for parse errors
b) Running some popular code metrics type utilities: phploc,pdepend
c) running phpcs with a custom ruleset which tries to follow mantis's rules
d) running phpunit tests
e) generating some api documentation
(atm, via phpdox, although should also generated via phpdoc2)
f) spit our a zip/tarball package of the build
Full build time is with codesniffer rules etc is around 2.5-3 minutes
locally
however, individual steps can be run:
For example:
phing phpcs will run codesniffer rules against code base.
phing phpunit will run php unit tests.
This is very much a first step - I suspect we will alter the tools,
add tools and commands etc, as we work out whats useful and what isn't.
For example, I've seen some phing build scripts that deal with creating
and merging between local branches/github PR's etc.