Download the PHP package sokil/deploy-bundle without Composer
On this page you can find all versions of the php package sokil/deploy-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package deploy-bundle
DeployBundle
Task runner for Symfony project
- Installation
- Configuration
- Tasks
- Git
- Configuring git task
- Private repositories
- Npm
- Webpack
- Bower
- Grunt
- Migrations
- Install Assets
- Dump Assetic
- Composer
- Clear cache
- Sync
- Writting own tasks
Installation
Add Composer dependency:
Add bundle to your AppKernel
:
Configuration
Configure tasks required to run in your app in app/config/config.yml
:
Section config
declared options of every task, able to run.
Section tasks
declares bundles of tasks, which run sequentially.
Tasks may be run by defining task aliases in cli command:
Also tasks bundles may be defined:
If no task specified then default
task bundle will be run. This task
bundle may be defined in configuration, but if it omitted,
then default task consists of all tasks in order of config
section.
Tasks and task bundles both may be specified in cli options, then tasks
will be run in order of first occurrence. Task bundle also may contain
other bundles.
To get list of all configured tasks run:
Tasks
- Git
- Npm
- Webpack
- Bower
- Grunt
- Migrations
- Install Assets
- Dump Assetic
- Composer
- Writing own tasks
Git
Configuring git task
Add configuration to your ./app/config/config.yml
:
Private repositories
If repository is private, password will be asked on pull:
For example web server started under www-data user. To prevent asking password,
add ssh keys to /home/$USER/.ssh
directory, using ssh key generation tool.
1) Generate keys:
2) Add public key to your repository to fetch changes without password prompt.
3) Test your connection:
Find out who use this key already:
Webpack
You can optionally specify path to webpack in pathToWebpack
parameter. If omitted , then webpack
will be used.
In this case webpack must be installed globally.
This will run command, where context
value is dirname of config in parameters config
:
Npm
Bower
Grunt
Add task configuration to your deploy config:
Grunt may have few tasks, and you can select which tasks to run.
In config:
As CLI parameter:
Migrations
Add dependency:
Register bundler in AppKerner
:
First, configure migrations in ./app/config/config.yml
:
Then add task to deploy config in ./app/config/config.yml
:
Install Assets
Then add task to deploy config in ./app/config/config.yml
:
Dump Assetic
Then add task to deploy config in ./app/config/config.yml
:
Bundles with Assetic assets must be defined in ./app/config/config.yml
:
Composer
This task will run composer command:
File composer.phar
must be in path, or you can redefine path to composer by param path
.
Add task config to ./app/config/config.yml
:
Clear cache
Sync
Task userd to sync data to production servers. Add configuration:
Parameter rules
define rules to sync files from source to destination.
May be configured any number of rules. Every rule consists of parameter
src
(defaults to "."), parameter dest
which may be string or array of hosts.
Other rule parameters same to rsync
options. See man page of rsync
to find description of this options.
Writing own tasks
First, create task class which extends Sokil\DeployBundle\Task\AbstractTask
. Then add Symfony's service definition:
This service must contain tag with name deploy.task
and alias, which will be used as CLI command's option name and configuration section name.
Then, you may add it to bundle's configuration in app/config/config.yml
to deploy
section in proper place of order, if you want it to be run automatically:
Now, your task will be calld third after git
and grunt
by calling deploy
command without arguments:
You also may call your task directly from console: