• Stars
    star
    202
  • Rank 193,691 (Top 4 %)
  • Language
    PHP
  • License
    Other
  • Created over 11 years ago
  • Updated almost 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

[Deprecated - This project is no longer maintained] A deployment tool for PHP

Altax

Build Status Coverage Status Latest Stable Version License

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.

This is a simple git deploy task definition. You can write any tasks in PHP.

// 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 [email protected]:path/to/app.git $appDir");
        } else {
            $process->run(array(
                "cd $appDir",
                "git pull",
                ));
        }

    }, array("web"));

});

You can run it like below

$ altax deploy
[web1.example.com:8550] Run: test -d /var/tmp/altax
[web1.example.com:8550] Run: git clone [email protected]: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 [email protected]: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/.

Requirement

PHP5.3 or later.

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.

$ 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.

$ altax
Altax version 3.0.0

Altax is a extensible deployment tool for PHP.
Copyright (c) Kohki Makimoto <[email protected]>
Apache License 2.0
...

Usage

I describe basic usage in this section.

Run altax init command to generate first configuration.

$ 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.

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.

$ 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 <[email protected]>
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.

$ altax hello
Hello world!

You got a first altax task now!

If you want to see more information, visit a documentation page.

Documentation

See documentation page.

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.

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.

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

And run altax update command which is a wrapper command of composer update for Altax.

$ 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.

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

Run the registered plugin task commnad.

$ altax adminer

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

If you are interested in Altax plugins, Search plugins at packagist!

Author

Kohki Makimoto [email protected]

License

Apache License 2.0

See LICENSE

Previous version

If you use Altax version 2. You can see 2.x branch. Altax version 1 is no longer maintained.

More Repositories

1

workerphp

[Deprecated - This project is no longer maintained] A PHP micro job scheduler framework like cron.
PHP
114
star
2

hq

HQ is a simplistic, language agnostic job queue engine communicated by HTTP messages.
Go
67
star
3

essh

Extended ssh command.
Go
56
star
4

BackgroundProcess

[Deprecated - This project is no longer maintained] BackgroundProcess is a PHP library to run background processes asynchronously on your system.
PHP
36
star
5

cofu

Minimum configuration management tool written in Go.
Go
33
star
6

FMDBx

[Deprecated - This project is no longer maintained] An extension of FMDB to provide ORM and migration functionality.
Objective-C
20
star
7

EArray

EArray is a small PHP class to provide convenient ways to access a PHP Array.
PHP
18
star
8

phpmigrate

PHPMigrate is a minimum database migration tool for MySQL.
PHP
13
star
9

getcomposer.org_doc_jp

Composerのドキュメント日本語訳
HTML
12
star
10

lib-migration

LibMigration is a minimum database migration library and framework for MySQL.
PHP
12
star
11

chef-for-centos

A sample chef repository and documents to setup steps for CentOS6. You don't use chef-server. You only use chef-solo and git.
Ruby
11
star
12

LaravelAdminer

It's a embedded adminer in laravel application.
PHP
10
star
13

inertia-echo

The Inertia.js server-side adapter for Echo Go web framework.
Go
8
star
14

selfsigned-crt

A script to generate self-signed SSL certificate.
Shell
8
star
15

BayesClassifier

This is a Bayes Classifier implementation written in PHP
PHP
7
star
16

gluayaml

Yaml parser for gopher-lua
Go
7
star
17

bash-boilerplate

Bash script boilerplate.
Shell
6
star
18

IntelliJDictionaryPlugin

Integrates OSX Dictionary.app with IntelliJ IDEA.
Java
5
star
19

gluafs

Filesystem utility for gopher-lua.
Go
5
star
20

html2pdf

A CLI tool for generating PDF from HTML by using Lua script.
Go
5
star
21

php-jwt

A php extension to encode and decode JSON Web Tokens (JWT).
C
5
star
22

gluatemplate

Text template for gopher-lua
Go
5
star
23

jitome

Jitome is a simple file watcher.
Go
5
star
24

omnibus-supervisor

Creating full-stack platform-specific packages for supervisor (only RPM).
Ruby
5
star
25

adminer-cli

Command line interface to run adminer on the PHP built-in server.
PHP
4
star
26

LaravelValidatorExtension

An extension of validator for Laravel4.
PHP
4
star
27

atom-dictionary

Integrates OSX Dictionary.app with Atom.
CoffeeScript
4
star
28

graceful

Graceful shutdown and restart for Go
Go
4
star
29

minio-rpmbuild

Script for creating unofficial RPM package of minio.
Shell
3
star
30

StaticProxy

StaticProxy provides static interface to an instance method.
PHP
3
star
31

vscode-mac-dictionary

Integrates Mac Dictionary.app with vscode.
TypeScript
3
star
32

bucketstore

Bucketstore is a pure Go embedded database engine to store JSON structure data.
Go
3
star
33

buildsh

Several script files make it easy to run commands in an isolated docker container for building, testing and deploying softwares.
Python
3
star
34

atom-atomenv

Loads environment variables from .atomenv.json
CoffeeScript
3
star
35

gptx

An extensible command-line utility powered by ChatGPT, designed to enhance your productivity.
Go
3
star
36

phpwebadmin

PHPWebAdmin is a administration tools pot written in PHP.
JavaScript
2
star
37

assetic-extension

My Assetic extention filters
PHP
2
star
38

gluaenv

Utility package for manipulating environment variables for gopher-lua
Go
2
star
39

luster

A command line application framework based on Laravel.
PHP
2
star
40

altax-adminer

Adminer runs on the php built-in web server via altax.
PHP
2
star
41

lightqueue

LightQueue is a simple job queue engine written in PHP.
PHP
2
star
42

CloudSQLProxyMenuBar

CloudSQLProxyMenuBar displays a menu to manage Cloud SQL Proxy processes on macOS menu bar.
Go
2
star
43

pingcrm-echo

A demo application to illustrate how Inertia.js works with inertia-echo.
Go
2
star
44

yumrepo-git-update

Shell
2
star
45

altax-server

Running php built-in web server via altax.
PHP
2
star
46

chatgpt-prompt-snippets-chrome-extension

ChatGPT Prompt Snippets is a Google Chrome Extension that helps you manage and utilize prompt snippets conveniently when using ChatGPT.
TypeScript
2
star
47

SiteGenerator

A simple static site generator.
PHP
2
star
48

symfony-AsyncComponentHelper

This is a symfony helper to load contents on asynchronous in the view.
PHP
1
star
49

gopher-lua-playground

GopherLua Playground is a convenient website where you can play with GopherLua.
JavaScript
1
star
50

chef-cookbooks-selenium

Chef cookbook to install selenium server.
Ruby
1
star
51

sshdocker

Run docker containers over SSH.
Go
1
star
52

govalidator-report

Go
1
star
53

TravisSSHClientTest

Work repository to try testing SSH client.
1
star
54

exgearscms

ExGearsCMS is a content management system for Google App Engine/Java. Currently an unstable preview release.
Java
1
star
55

LaravelMessageBinder

A little hack for Illuminate View to access flash messages easily.
PHP
1
star
56

gluaquestion

A library of gopher-lua to prompt the user for input.
Go
1
star
57

ApplicationConfigServiceProvider

Silex ServiceProvider for configuration files
PHP
1
star
58

genhosts

genhosts - generate hosts file from /etc/hosts.d/*.conf
1
star
59

browser-qrcode-reader

This is an example web app to read QR code in browser.
TypeScript
1
star
60

crun

Crun (Command-RUN) is a command execution wrapper.
Go
1
star
61

loglv

A package supports leveled logging for Go standard log package.
Go
1
star
62

go-i18n

Go
1
star
63

execmysql

This is a very simple bash script to execute some sql files to mysql database and output results to text files.
Shell
1
star
64

Temporary

A PHP helper class to manipulate a temporary file and directory.
PHP
1
star
65

go-sqlexec

go-sqlexec is a library to execute SQLs from various sources such as files, directory and strings.
Go
1
star
66

docker-rpmbuild

1
star