Build deb package of PHP application using Robo task runner.
First install this package as composer dependency:
composer require vysokeskoly/deb-build:dev-master
- NOTE it must NOT be installed as
--dev
dependency, as it is needed forpostinst
which is triggered on during installation on target server.
Then you can copy example RoboFile.php
:
cd {YOUR_PROJECT}
cp vendor/vysokeskoly/deb-build/example/RoboFile.php ./RoboFile.php
Now just edit RoboFile.php
and resolve all TODOs
and check/edit other configuration.
- You can require
Tasks
andTraits
in your ownRoboFile.php
. - Or you can use the predefined autoloader:
require __DIR__ . '/vendor/vysokeskoly/deb-build/src/autoload.php';
- It is not recommended (though it may be possible in some cases) to use
vendor/autoload.php
of your application, because it may (and most probably will) conflict withrobo.phar
inner dependencies (likeSymfony
).
sudo apt-get install ruby-dev gcc make
sudo gem install fpm
export BUILD_NUMBER=666
bin/robo build:deb