Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Deployer guide #1071

Merged
merged 8 commits into from
Dec 1, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions docs/manual/guides/deployer.de.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ Diese Anleitung bezieht sich auf die Deployer-Version >=7.0 und Contao-Version >

Zuerst musst du Deployer installieren: [https://deployer.org/docs/][1]

Du kannst Deployer entweder global oder per Projekt (mit Composer) installieren. Der Kommandozeilenbefehl lautet
entsprechend `dep` oder `./vendor/bin/dep`.
```bash
composer require --dev deployer/deployer
```

Bevor du weitermachst, stelle sicher, dass du mindestens Version _7.0.0-rc.5_ installiert hast (`dep --version`).
Bevor du weitermachst, stelle sicher, dass du mindestens Version _7.0_ installiert hast (`vendor/bin/dep --version`).

Jetzt kannst du deine `deploy.php`-Datei in dem Projekt erstellen:

Expand Down Expand Up @@ -113,8 +114,9 @@ hinter Deployer ist, dass es keine Downtime bei Updates gibt. Deswegen werden ro
Document-Root von deinem vHost musst du entsprechend auf `/current/public` (bzw. `/current/web`) einstellen. Ein
komplettes Beispiel für einen Document-Root wäre: `/var/www/foobar/html/example.org/current/public`.

Contao migriert langsam zum `/public`-Ordner als Web-Root. Wenn du in Contao 4.13 noch den `/web`-Ordner verwendest,
dann definiere diesen entsprechend, damit Deployer das auch weiß.
{{% notice "info" %}}
Contao verwendet standardmäßig den `/public`-Ordner als Web-Root. Wenn deine Contao-Installation noch den alten `/web`-Ordner
verwendet, dann definiere diesen entsprechend in `composer.json`, damit Deployer das auch weiß.

```json
{
Expand All @@ -123,7 +125,7 @@ dann definiere diesen entsprechend, damit Deployer das auch weiß.
}
}
```

{{% /notice %}}
netzarbeiter marked this conversation as resolved.
Show resolved Hide resolved

## Projektspezifische Tasks

Expand All @@ -147,7 +149,7 @@ before('deploy', 'encore:compile');

## Und nun: Deployen!

Nachdem wir alles konfiguriert haben, können wir jetzt `dep deploy` ausführen und das Projekt auf den Webserver
Nachdem wir alles konfiguriert haben, können wir jetzt `vendor/bin/dep deploy` ausführen und das Projekt auf den Webserver
deployen.


Expand Down Expand Up @@ -176,6 +178,14 @@ before('deploy:publish', 'contao:manager:download');
after('contao:manager:download', 'contao:manager:lock');
```

Verwendest du Contao Manager nicht, dann kannst du den leeren Ordner von "Shared folders" ausschließen:
ameotoko marked this conversation as resolved.
Show resolved Hide resolved

```php
// deploy.php

set('shared_dirs', array_diff(get('shared_dirs'), ['contao-manager']));
```


### Probleme mit dem Symlink und OPCache / APCu

Expand Down
24 changes: 18 additions & 6 deletions docs/manual/guides/deployer.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ The Deployer recipe is part of Deployer 7 and is intended to work for Contao 4.1

## Install Deployer

If not done yet, install Deployer as described here: [https://deployer.org/docs/][1]
If not done yet, install Deployer in your project as described [in the docs:][1]

You can either install Deployer globally or per project and use the command `dep` or `./vendor/bin/dep` respectively.
```bash
composer require --dev deployer/deployer
```

Verify that you are running Deployer in the minimum version _7.0.0-rc.5_ by running `dep --version`.
Verify that you are running Deployer in the minimum version _7.0_ by running `vendor/bin/dep --version`.

Once done, you can create a `deploy.php` file in your project:

Expand Down Expand Up @@ -107,8 +109,9 @@ this, Deployer utilizes rolling symlink releases. Consequently, you have to set
`/current/public` (or `/current/web` respectively). A full example for the document root might look like
`/var/www/foobar/html/example.org/current/public`.

Contao is slowly migrating to use the `/public` folder of the project as the document root. When your Contao 4.13
installation is still using the folder `/web` as public directory, please explicitly set it in the `composer.json`
{{% notice "info" %}}
By default, Contao uses the `/public` folder of the project as the document root. If your Contao
installation is still using the legacy `/web` folder as public directory, please explicitly set it in the `composer.json`
of the project:

```json
Expand All @@ -118,6 +121,7 @@ of the project:
}
}
```
{{% /notice %}}

## Add build-task to deployment

Expand All @@ -141,7 +145,7 @@ before('deploy', 'encore:compile');

## Finally: Deploy

You are now all set to run `dep deploy`.
You are now all set to run `vendor/bin/dep deploy`.

## Tips

Expand All @@ -168,6 +172,14 @@ before('deploy:publish', 'contao:manager:download');
after('contao:manager:download', 'contao:manager:lock');
```

If you don't use Contao Manager, you can prevent empty folder from being deployed by excluding it from shared folders:
ameotoko marked this conversation as resolved.
Show resolved Hide resolved

```php
// deploy.php

set('shared_dirs', array_diff(get('shared_dirs'), ['contao-manager']));
```

### Symlink issues with OPCache / APCu

As Deployer is using a symlink for the document root (as read above), issues might occur with internal caches like the
Expand Down