2017 © Pedro Peláez
 

library altax

Altax is an extensible deployment tool for PHP.

image

kohkimakimoto/altax

Altax is an extensible deployment tool for PHP.

  • Tuesday, November 21, 2017
  • by kohkimakimoto
  • Repository
  • 16 Watchers
  • 213 Stars
  • 2,780 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 14 Forks
  • 1 Open issues
  • 38 Versions
  • 0 % Grown

The README.md

Altax

Build Status Coverage Status Latest Stable Version License, (*1)

Altax is a deployment tool for PHP. I designed it as a command-line tool for running tasks to remote servers like the Capistrano, Fabric and Cinamon. It also has a plugin mechanism for managing and installing tasks easily., (*2)

This is a simple git deploy task definition. You can write any tasks in PHP., (*3)

// Register managed nodes to a role.
Server::node("web1.example.com", "web");
Server::node("web2.example.com", "web");
Server::node("db1.example.com",  "db");

// Register a task.
Task::register("deploy", function($task){

    $appDir = "/path/to/app";

    // Execute parallel processes for each nodes.
    $task->exec(function($process) use ($appDir){

        // Run a command remotely and get a return code.
        if ($process->run("test -d $appDir")->isFailed()) {
            $process->run("git clone git@github.com:path/to/app.git $appDir");
        } else {
            $process->run(array(
                "cd $appDir",
                "git pull",
                ));
        }

    }, array("web"));

});

You can run it like below, (*4)

$ altax deploy
[web1.example.com:8550] Run: test -d /var/tmp/altax
[web1.example.com:8550] Run: git clone git@github.com:kpath/to/app.git /path/to/app
Initialized empty Git repository in /path/to/app/.git/
[web2.example.com:8551] Run: test -d /var/tmp/altax
[web3.example.com:8551] Run: git clone git@github.com:kpath/to/app.git /path/to/app
Initialized empty Git repository in /path/to/app/.git/

You can get more information at http://kohkimakimoto.github.io/altax/., (*5)

Requirement

PHP5.3 or later., (*6)

Installation

I recommend you to install Altax as a phar (PHP Archive) which compiled to single executable file. Run the below command to get latest version of Altax., (*7)

$ curl -L https://raw.githubusercontent.com/kohkimakimoto/altax/master/installer.sh | bash -s system

You will get altax command file to /usr/local/bin directory. In order to check installation, execute just altax command., (*8)

$ altax
Altax version 3.0.0

Altax is a extensible deployment tool for PHP.
Copyright (c) Kohki Makimoto <kohki.makimoto@gmail.com>
Apache License 2.0
...

Usage

I describe basic usage in this section., (*9)

Run altax init command to generate first configuration., (*10)

$ altax init
Created file: /path/to/your/directory/.altax/config.php
Created file: /path/to/your/directory/.altax/composer.json
Created file: /path/to/your/directory/.altax/.gitignore

Created .altax/config.php file in your current directory is a main configuration file for altax. You can modify this file to define tasks and servers you managed. So now, add the following code in the file., (*11)

Task::register("hello", function($task){

  $task->writeln("Hello world!");

})->description("This is a first sample task.");

This is a simple task definition. Defined task is listed by executing just altax command., (*12)

$ altax
Altax version 3.0.0

Altax is a deployment tool for PHP.
it's designed as a command-line tool for running tasks to remote servers.
Copyright (c) Kohki Makimoto <kohki.makimoto@gmail.com>
Apache License 2.0

...

Available commands:
  hello   This is a first sample task.
  ...

hello task you defined can be executed by altax command with task name like the followiing., (*13)

$ altax hello
Hello world!

You got a first altax task now!, (*14)

If you want to see more information, visit a documentation page., (*15)

Documentation

See documentation page., (*16)

Plugins

Altax has a extensible plugin mechanism. It makes adding functionality easy. Plugins are stored at Packagist and installed using composer. As Altax includes embedded composer, you can install plugins by altax command., (*17)

For instance, if you use PHP5.4 and MySQL database in your product, you can use Adminer database management tool via Altax plugin. Edit your .altax/composer.json file like the following., (*18)

{
  "require": {
    "kohkimakimoto/altax-adminer": "dev-master"
  }
}

And run altax update command which is a wrapper command of composer update for Altax., (*19)

$ altax update

Adminer altax plugin will be installed in your .altax/vendor directory. In order to register the plugin to your task, add the following line your .altax/config.php file., (*20)

Task::register('adminer', 'Altax\Contrib\Adminer\Command\AdminerCommand');

Run the registered plugin task commnad., (*21)

$ altax adminer

Altax runs adminer on built-in web server. So you can use adminer at http://localhost:3000/., (*22)

If you are interested in Altax plugins, Search plugins at packagist!, (*23)

Author

Kohki Makimoto kohki.makimoto@gmail.com, (*24)

License

Apache License 2.0, (*25)

See LICENSE, (*26)

Previous version

If you use Altax version 2. You can see 2.x branch. Altax version 1 is no longer maintained., (*27)

The Versions

26/12 2013

2.x-dev

2.9999999.9999999.9999999-dev https://github.com/kohkimakimoto/altax

Altax is a simple deployment tool running SSH in parallel.

  Sources   Download

Apache License 2.0

The Requires

 

The Development Requires

ssh deployment deploy

24/12 2013
21/10 2013
21/10 2013
21/10 2013
21/10 2013
18/10 2013

v2.1.5

2.1.5.0 https://github.com/kohkimakimoto/altax

Altax is a simple deployment tool running SSH in parallel.

  Sources   Download

Apache License 2.0

The Requires

 

The Development Requires

ssh deployment deploy

18/10 2013

v2.1.4

2.1.4.0 https://github.com/kohkimakimoto/altax

Altax is a simple deployment tool running SSH in parallel.

  Sources   Download

Apache License 2.0

The Requires

 

The Development Requires

ssh deployment deploy

17/10 2013

v2.1.3

2.1.3.0 https://github.com/kohkimakimoto/altax

Altax is a simple deployment tool running SSH in parallel.

  Sources   Download

Apache License 2.0

The Requires

 

The Development Requires

ssh deployment deploy

09/10 2013

v2.1.2

2.1.2.0 https://github.com/kohkimakimoto/altax

Altax is a simple deployment tool running SSH in parallel.

  Sources   Download

Apache License 2.0

The Requires

 

The Development Requires

ssh deployment deploy

01/10 2013

v2.1.0

2.1.0.0 https://github.com/kohkimakimoto/altax

Altax is a simple deployment tool running SSH in parallel.

  Sources   Download

Apache License 2.0

The Requires

 

The Development Requires

ssh deployment deploy

27/09 2013

v2.0.0

2.0.0.0 https://github.com/kohkimakimoto/altax

Altax is a simple deployment tool running SSH in parallel.

  Sources   Download

Apache License 2.0

The Requires

 

The Development Requires

ssh deployment deploy

12/07 2013

v1.3.1

1.3.1.0 https://github.com/kohkimakimoto/altax

Altax is a simple deployment tool running SSH in parallel.

  Sources   Download

Apache License 2.0

The Requires

  • php >=5.3.0

 

The Development Requires

ssh deployment deploy

10/07 2013

v1.3.0

1.3.0.0 https://github.com/kohkimakimoto/altax

Altax is a simple deployment tool running SSH in parallel.

  Sources   Download

Apache License 2.0

The Requires

  • php >=5.3.0

 

The Development Requires

ssh deployment deploy

27/06 2013

v1.2.0

1.2.0.0 https://github.com/kohkimakimoto/altax

Altax is a simple deployment tool running SSH in parallel.

  Sources   Download

Apache License 2.0

The Requires

  • php >=5.3.0

 

The Development Requires

ssh deployment deploy