Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/m-adamski/symfony-deployer-bundle

Bundle for Symfony for easier Deployer configuration
https://github.com/m-adamski/symfony-deployer-bundle

deployer-bundle php symfony symfony-bundle

Last synced: 26 days ago
JSON representation

Bundle for Symfony for easier Deployer configuration

Awesome Lists containing this project

README

        

# Deployer Bundle for Symfony

Bundle for Symfony for easier Deployer configuration.

This bundle is compatible with Symfony 4.1 and Symfony 5.0. Symfony 3.4 compatibility abandoned.

## Installation

This bundle can be installed by Composer:

```bash
$ composer require m-adamski/symfony-deployer-bundle
$ composer require deployer/deployer --dev
```

## Deployer Configuration

In addition to installing this package, you must also create configuration files that it will use.
You can use the prepared script or create configuration files manually.

**Automatically**

Run the command from the root project directory:
```bash
$ vendor/bin/create-config
```

**Manually**

Create ``.deployer`` directory in your project's root directory. Then create four files in the newly added directory:

* config.php
* deployer.php
* hosts.php
* tasks.php

Complete the files with default values and then adapt them to your requirements.

``config.php``
```php
stage("production")
->user("deployer")
->identityFile(__DIR__ . "/.ssh/production/deployer_rsa")
->addSshOption("UserKnownHostsFile", "/dev/null")
->addSshOption("StrictHostKeyChecking", "no")
->set("php_version", "php7.2-fpm")
->set("deploy_path", "/var/www/vhosts/example.com")
->set("branch", "master");
```

``tasks.php``
```php
desc("Restart PHP");

task("deploy:writable:prepare", function () {
$dirs = join(" ", get("writable_dirs"));

cd("{{ release_path }}");
run("echo '{{ sudo_password }}' | sudo -S setfacl -RL -m mask:rwX $dirs");
})->desc("Prepare writable");
```

The last step is to make changes to the configuration files according to own needs.

## License

MIT