2017 © Pedro Peláez
 

project deploy-agent

Deploy agent for continuousphp

image

continuousphp/deploy-agent

Deploy agent for continuousphp

  • Monday, January 16, 2017
  • by continuousphp
  • Repository
  • 10 Watchers
  • 15 Stars
  • 81 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 9 Forks
  • 2 Open issues
  • 13 Versions
  • 0 % Grown

The README.md

Continuous Deploy Agent

Master :
Master branch status
Develop :
Develop branch status, (*1)

Automated deployment agent to install on your servers., (*2)

It manages automated deployment workflows based on webhooks for your projects., (*3)

Requirements

  • PHP 5.5+
  • PHP mcrypt extension
  • sqlite or other doctrine compatible SGBD (sqlite is currently the only one officially supported)

:warning: the PHP sqlite extension is not installed by default., (*4)

Installation by Docker ( Container Service )

You can use our Docker image as a container service. The container is isolated from the rest of your Server and you have not to worry about server dependencies or security., (*5)

Thanks to report to Docker-Hub documentation., (*6)

Installation by Composer

  • Download Composer: curl -sS https://getcomposer.org/composer.phar -o composer.phar
  • Install the Deploy Agent: php composer.phar create-project continuousphp/deploy-agent
  • Start using the agent: cd deploy-agent && ./agent

HTTP server config

To setup apache, setup a virtual host that points to the public/ directory of the project and you should be ready to go! It should be something similar to:, (*7)

<VirtualHost *>
    DocumentRoot /path/to/deploy-agent/public
    <Directory /path/to/deploy-agent/public>
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

Also enable apache mod rewrite in order to support webhook routes, (*8)

a2enmod rewrite, (*9)

Usage

List your applications

./agent list applications

Create an application

./agent add application [--provider=] [--token=] [--repository-provider=] [--repository=] [--pipeline=] [--name=] [--path=]
  • --provider The application provider to use (currently, continuousphp is the only supported application provider)
  • --token A valid token to consume the provider API (ie: continuousphp API token)
  • --repository-provider The repository provider to use (ie: git-hub, bitbucket...)
    (for continuousphp only)
  • --repository The repository key to use (ie: continuousphp/deploy-agent)
  • --pipeline The pipeline to use (ie: refs/heads/master)
    (for continuousphp only)
  • --name The name of the application
  • --path The destination path of the application

Token

The token depends on the Provider. At this time, the continousphp API is the only one supported. You can retrieve your personal token on your Profile page at continuousphp.com/profile, (*10)

Deploy an application

./agent deploy application [--name=] [--build=]
  • --name The name of the application
  • --build The ID of the build to deploy

Application path

When a deployment occurs, the Deploy Agent creates a new folder for every build in its dedicated workspace. To enable the new build, it will create/update a symlink to the current build, (*11)

[application-path]
        |
        +---[/current] (symlink to current build)
        |
        +---[/build-1]
        |
        +---[/build-2]

Hooks

During the deployment workflow the Deploy Agent can execute project specific commands through hooks to define in a continuous.yml file as following:, (*12)

# continuous.yml
deployment:
  hooks:
    AfterInstall:
      - command: echo 'the application is successfully installed'
    BeforeActivate:
      - command: echo 'the application is going to start'
    AfterActivate:
      - command: echo 'the application has started'

Webhook setup

The URL of the hook to implement in continuousphp is <baseuri>/webhook/continuousphp. Configure it as following: continuousphp setup, (*13)

Events

  • AfterInstall : triggered just after the application package has been extracted
  • BeforeActivate : triggered just before the symlink update
  • AfterActivate : triggered just after the symlink update

Contributing

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms., (*14)

Feel free to fork the project, create a feature branch, and send us a pull request!, (*15)

The Versions

16/01 2017

dev-master

9999999-dev https://github.com/continuousphp/deploy-agent

Deploy agent for continuousphp

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

deployment tool build agent continuousphp

16/01 2017

0.2.2

0.2.2.0 https://github.com/continuousphp/deploy-agent

Deploy agent for continuousphp

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

deployment tool build agent continuousphp

13/01 2017

dev-docker/enhancement

dev-docker/enhancement https://github.com/continuousphp/deploy-agent

Deploy agent for continuousphp

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

deployment tool build agent continuousphp

09/01 2017

dev-enhancement/doc

dev-enhancement/doc https://github.com/continuousphp/deploy-agent

Deploy agent for continuousphp

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

deployment tool build agent continuousphp

14/11 2016

0.2.0

0.2.0.0 https://github.com/continuousphp/deploy-agent

Deploy agent for continuousphp

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

deployment tool build agent continuousphp

14/11 2016

0.2.1

0.2.1.0 https://github.com/continuousphp/deploy-agent

Deploy agent for continuousphp

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

deployment tool build agent continuousphp

14/11 2016

dev-targz-extractor

dev-targz-extractor https://github.com/continuousphp/deploy-agent

Deploy agent for continuousphp

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

deployment tool build agent continuousphp

14/11 2016

dev-cass/docker

dev-cass/docker https://github.com/continuousphp/deploy-agent

Deploy agent for continuousphp

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

deployment tool build agent continuousphp

14/11 2016

0.1.2

0.1.2.0 https://github.com/continuousphp/deploy-agent

Deploy agent for continuousphp

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

deployment tool build agent continuousphp

07/11 2016

dev-temp-cleanup

dev-temp-cleanup https://github.com/continuousphp/deploy-agent

Deploy agent for continuousphp

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

deployment tool build agent continuousphp

06/10 2016

dev-cwd-command

dev-cwd-command https://github.com/continuousphp/deploy-agent

Deploy agent for continuousphp

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

deployment tool build agent continuousphp

19/09 2016

0.1.1

0.1.1.0 https://github.com/continuousphp/deploy-agent

Deploy agent for continuousphp

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

deployment tool build agent continuousphp

26/06 2016

0.1.0

0.1.0.0 https://github.com/continuousphp/deploy-agent

Deploy agent for continuousphp

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

deployment tool build agent continuousphp