2017 © Pedro Peláez
 

library droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

image

droid/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  • Tuesday, February 28, 2017
  • by joostfaassen
  • Repository
  • 3 Watchers
  • 10 Stars
  • 401 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 4 Forks
  • 3 Open issues
  • 37 Versions
  • 1 % Grown

The README.md

, (*1)

Droid is a task-runner, similar to Apache Ant, Gulp, Grunt, Phing, etc., (*2)

It helps you to automatically build your project, compile assets, create directory structures, run and validate tests, setup fixtures, and eventually deploy your app., (*3)

Tasks are implemented as standard Symfony Commands, allowing you to use standard existing commands to script your builds., (*4)

Installation

Add the following line to your composer.json:, (*5)

"require": {
   "droid/droid": "~1.0"
}

Then run composer update to install your updated required packages., (*6)

Configuring droid for your project

Create a droid.yml file in the root of your repository. For example:, (*7)

targets:
   default:
      name: "Building it"
      tasks:
         - "composer:install":
            prefer: dist
         - "bower:install": ~
   cs:
      requires:
         - default
      tasks:
         - "phpcs:check": ~

   test:
      requires:
         - build
         - cs
      tasks:
         - "phpunit:test": ~

   deploy:
      requires:
         - build
      loop:
         -
            host: app1.example.com
            port: 22
         -
            host: app2.example.com
            port: 2222

      tasks:
         - "deploy:ssh":
            sshkey: "{{ deploy.sshkey }}"
            basepath: "/code/myapp/"

At the top level, you define the "targets". When you run droid, you always pass a target name. It uses target name "default" if none is specified., (*8)

For each target, you can define a set of "tasks". Each task has a command name (for example "core:echo") and a list of arguments for that command., (*9)

Running droid

Running a target

vendor/bin/droid run

This will run the "default" target., (*10)

Alternatively, you can specify which target to run:, (*11)

vendor/bin/droid run test

Listing available commands

vendor/bin/droid list

This lists the available commands you can use in your droid.yml file., (*12)

Registering your own custom commands

To register custom commands, you can add the following section to your droid.yml:, (*13)

register:
    - Haigha\Command\LoadCommand: ~

When you list the available commands, you'll find that Haiga's fixture:load command has been added to the available command list. You can now use it as a command in your target tasks., (*14)

If you'd like to change the default 'name' for the registered command, simply pass a name parameter:, (*15)

register:
    - Haigha\Command\LoadCommand:
        name: "haigha:load"

Creating plugins for Droid

Droid plugins are composer packages that can automatically register their commands in droid. The consuming application won't need to use the register key in their droid.yml., (*16)

You can easily turn your php package into a Droid plugin by including a class called DroidPlugin in the root of your library's PHP namespace. For example, if your project's namespace is 'Acme\MyApp', you can add a file in the root of that namespace called 'DroidPlugin' like this:, (*17)

<?php

namespace Acme\MyApp;

class DroidPlugin
{
    public function __construct($droid)
    {
        $this->droid = $droid;
    }

    public function getCommands()
    {
        $commands = [];
        $commands[] = new \Acme\MyApp\Command\MyFirstCommand();
        $commands[] = new \Acme\MyApp\Command\MySecondCommand();
        return $commands;
    }
}

The constructor gets access to the Droid\\Application instance. You'll need to implement a method called getCommands that returns a list of Symfony Console Commands., (*18)

After including both droid/droid and your custom package in a project, you'll have access to all of the default Droid commands, and all the commands returned by your DroidPlugin::getCommands method., (*19)

Get information about a command

To see how you can use a command, run:, (*20)

vendor/bin/droid help core:echo

This will list the available arguments and options available in the core:echo command., (*21)

You can simply add these arguments in your droid.yml file like this:, (*22)

   tasks:
      - "core:echo":
         message: "Hello world from the echo task!"
      - "core:echo":
         message: "This should be in red"
         color: "red"

When you're trying to use a command, and forget to specify any required arguments, droid will tell you what's missing., (*23)

TODO:

  • [ ] Finish core commands (this is WIP!)
  • [ ] Implement a set of commands, for running composer, bower, deploy and other functionality
  • [ ] Split core commands into droid-plugin repositories
  • [ ] Implement commands for building docker containers

License

MIT. Please refer to the license file for details., (*24)

Brought to you by the LinkORB Engineering team


Check out our other projects at linkorb.com/engineering., (*25)

Btw, we're hiring!, (*26)

The Versions

28/02 2017

dev-master

9999999-dev http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

20/12 2016

v1.23.1

1.23.1.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

20/12 2016

v1.23.0

1.23.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

05/12 2016

v1.22.0

1.22.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

28/11 2016

v1.21.1

1.21.1.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

25/11 2016

v1.21.0

1.21.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

20/10 2016

v1.20.0

1.20.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

30/09 2016

v1.19.0

1.19.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

25/09 2016

v1.18.1

1.18.1.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

25/09 2016

v1.18.0

1.18.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

03/09 2016

v1.17.1

1.17.1.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

03/09 2016

v1.17.0

1.17.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

22/08 2016

v1.16.2

1.16.2.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

21/08 2016

v1.16.1

1.16.1.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

21/08 2016

v1.16.0

1.16.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

11/08 2016

v1.15.0

1.15.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

10/08 2016

v1.14.0

1.14.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

08/08 2016

v1.13.0

1.13.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

21/06 2016

v1.12.0

1.12.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

21/05 2016

v1.11.0

1.11.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

15/05 2016

v1.10.1

1.10.1.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

15/05 2016

v1.10.0

1.10.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

15/05 2016

v1.9.2

1.9.2.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

15/05 2016

v1.9.1

1.9.1.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

15/05 2016

v1.9.0

1.9.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

14/05 2016

v1.8.0

1.8.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

14/05 2016

v1.7.0

1.7.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

05/05 2016

v1.6.0

1.6.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

26/04 2016

v1.5.1

1.5.1.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

17/04 2016

v1.5.0

1.5.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

17/04 2016

v1.4.0

1.4.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

17/04 2016

v1.3.1

1.3.1.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

16/04 2016

v1.3.0

1.3.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

03/04 2016

v1.2.0

1.2.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

03/04 2016

v1.1.1

1.1.1.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

03/04 2016

v1.1.0

1.1.0.0 http://www.github.com/droid-php/droid

Droid: a Taskrunner to Build, Test, CI, deploy your app

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb taskrunner droid task-runner

03/04 2016

v1.0.0

1.0.0.0 http://www.github.com/droid-php/droid

Droid: Build, Test, CI, deploy

  Sources   Download

MIT

The Requires

 

The Development Requires

by LinkORB Engineering

php ci continuous integration deploy build linkorb droid