Download the PHP package totallydave/auto-deploy without Composer
On this page you can find all versions of the php package totallydave/auto-deploy. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download totallydave/auto-deploy
More information about totallydave/auto-deploy
Files in totallydave/auto-deploy
Package auto-deploy
Short Description Auto deployment module for Zend Framework 2
License MIT
Homepage https://github.com/totallydave/AutoDeploy
Informations about the package auto-deploy
What is AutoDeploy?
AutoDeploy is framework agnostic auto deployment application with added support as a ZF2-Module which provides a service to auto deploy code utilising web hooks from VCS providers.
AutoDeploy is still in development
Available services
- Vcs (Git)
- Dm - Dependency Manager (Composer)
- Db - Database Migrations (Executing MySql migration file/s)
Notes
- Dm and Db services depend on a Vcs service
- Db service will be run last
- Db migration files must begin with '_autodeploy\' this allows them to be ommitted from auto deployment
- An error on the Db service will roll the other services back so it's important Vcs is run first (@todo force this)
- An email log will be sent to any commiters in the update
- If logging is enables a log will be written to the file system
Installation
Add the below to the top of your index.php or web root php file
ZF2 CONFIGURATION
Create an auto_deploy.php and place in config/autoload by running the below
Update the default configuration as you need (below is the minimum you'll need to get up and running)
Add 'AutoDeploy' to your registered modules in application.config.php
GENERAL CONFIGURATION (NOT ZF2)
Create an auto_deploy.php somewhere outside your web root in the following example I will be using 'config/auto_deploy.php' relative to the project root
Replace the values in [] below - i.e. [GIT BRANCH]
Create and exclude log directory 'var/log' from vcs
Place the below at the top of your web root php file after 'APPLICATION_ROOT' definition so any requests for '/auto-deploy/' will be handled by AutoDeploy before hitting you application
Ensure the '../vendor/autoload.php' and 'config/auto_deploy.php' path is correct to your application structure.
GENERAL INSTALLATION CONTINUED (INCLUDING ZF2)
Configure web hook in your chosen vcs provider to call [YOUR APPLICATION URL]/auto-deploy/ on push event
Prerequisites
- composer must be available globally by using command 'composer' to user composer service
- mysql-server must be installed to use mysql db service
- git must be installed to user git vcs service
GOTCHAS
- auto_deploy.ipAddress : IP of VCS server must be added in config [GIT SERVER PROVIDER IP]
- application.email : correctly configure this or you might find the emails end up in your spam
- application.email.allowedDevEmailDomains : this relies on php environment variable 'env'
- auto_deploy.services.db : create and exclude backupDir from vcs
- auto_deploy.services.db : migration depends on vcs
- auto_deploy.services.db : migration files must start with '_autodeploy\'
- auto_deploy.services.db : sql update files should contain the database that is being updated
- auto_deploy.log : create and exclude log dir from vcs
@todo
- add rollback for other failures
- write rollback for db
- allow multiple services within each type
- write unit tests