PHPackages                             sourcebroker/deployer-typo3-deploy-ci - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. sourcebroker/deployer-typo3-deploy-ci

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

sourcebroker/deployer-typo3-deploy-ci
=====================================

Deploy for TYPO3 with Deployer at CI level

2.0.0(11mo ago)012.6k—8.6%1[1 issues](https://github.com/sourcebroker/deployer-typo3-deploy-ci/issues)2MITPHP

Since Mar 1Pushed 4mo ago4 watchersCompare

[ Source](https://github.com/sourcebroker/deployer-typo3-deploy-ci)[ Packagist](https://packagist.org/packages/sourcebroker/deployer-typo3-deploy-ci)[ RSS](/packages/sourcebroker-deployer-typo3-deploy-ci/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (20)Used By (2)

deployer-typo3-deploy-ci
========================

[](#deployer-typo3-deploy-ci)

[![Packagist](https://camo.githubusercontent.com/0a7e89f72908ac129f6bf6966bf51a22deaa7e1dde91ee4feafc5812bcfd12b9/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f736f7572636562726f6b65722f6465706c6f7965722d7479706f332d6465706c6f792d63692e7376673f7374796c653d666c6174)](https://packagist.org/packages/sourcebroker/deployer-typo3-deploy-ci) [![License](https://camo.githubusercontent.com/f48f8d6cf609f5b181b9c3218a85175fe8a5809c7ea400347f39697a5d55065d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c6174)](https://packagist.org/packages/sourcebroker/deployer-typo3-deploy-ci)

Contents
--------

[](#contents)

- [Introduction](#introduction)
- [Installation](#installation)
- [Stages](#stages)
- [Variables](#variables)
- [Deployer Tasks](#deployer-tasks)
- [Own repo for overwrites](#own-repo-for-overwrites)
- [Example configs](#example-configs)

Introduction
------------

[](#introduction)

This is a template for TYPO3 CMS projects that need continuous integration and deployment.

For now, it uses only GitLab CI/CD (Deployer).

**The aim is to have minimal config at `gitlab-ci.yml` of projects and keep the base of CI/CD config outside of projects' repositories.**

You can use this repository in several possible ways:

1. Reference it from your project with "include remote" and overwrite at your project's `gitlab-ci.yml`.
2. Reference it from your project with "include remote", then overwrite it with "include remote" from your own special repo and finally overwrite edge cases at the project's `gitlab-ci.yml`.

The worst possible scenario you can use is to copy all CI/CD files to your project repository and maintain them there for each project. This is not recommended as it will be hard for you to maintain and upgrade in the future if you have several dozen projects and each has its own CI/CD config inside the project's repo.

Installation
------------

[](#installation)

1. Install with composer:

    ```
    composer require sourcebroker/deployer-typo3-deploy-ci
    ```
2. Create a file `gitlab-ci.yml` in the root of your project and put the content below.

    ```
    include:
      - remote: https://raw.githubusercontent.com/sourcebroker/deployer-typo3-deploy-ci/2.0.0/ci/provider/gitlab/main.yaml

    variables:
      PHP: '8.2'
      NODE: '20'
      DEPLOY_TRIGGER_BY_CI_COMMIT_BRANCH: /^(develop|main)$/
      DEPLOYER_SELECTOR_FOR_BRANCH: develop:staging,main:preprod
      DEPLOYER_SELECTOR_FOR_TAG: prod
    ```

    Adapt the tag version in the include remote URL. This version should be the same as the version of `deployer-typo3-deploy-ci`installed in your project in step 1 with composer. Use: `composer show | grep 'sourcebroker/deployer-typo3-deploy-ci'`to see the version of the `deployer-typo3-deploy-ci` installed in your project.

    If after pushing the pipeline does not start at all, check the `TEST_TRIGGER_BY_CI_COMMIT_BRANCH` value. The name of the branch you push to must be inside the pregmatch of `TEST_TRIGGER_BY_CI_COMMIT_BRANCH`.
3. **Backend test**. The command for backend test is defined in `BACKEND_COMMAND_TEST` and has the value:

    ```
    composer install --prefer-dist --no-progress --no-interaction --optimize-autoloader && composer test
    ```

    You can either overwrite it in your `gitlab-ci.yml` or you can just add a `test` script in your `composer.json`.
4. **Frontend test**. The command for frontend test is defined in `FRONTEND_COMMAND_TEST` and has the value:

    ```
    cd assets && npm ci && npm run test
    ```

    This is probably a part you would like to overwrite as this is very custom and not normalized in the TYPO3 world. Just change `FRONTEND_COMMAND_TEST` to your needs in your `gitlab-ci.yml`.
5. **Build the backend**. The command for backend build is defined in `BACKEND_COMMAND_BUILD` and has the value:

    ```
    composer install --prefer-dist --no-progress --no-interaction --optimize-autoloader --no-dev
    ```

    You probably do not want to overwrite it as this is the default for all PHP projects.
6. **Build the frontend**. The command for frontend build is defined in `FRONTEND_COMMAND_BUILD` and has the value:

    ```
    cd assets && npm ci && npm run prod
    ```

    You can either overwrite it in your `gitlab-ci.yml`. If you modify the `FRONTEND_COMMAND_TEST` command, remember to also modify the `FRONTEND_FOLDER_BUILD_1`.
7. **Deploy**. Add the `SSH_PRIVATE_KEY` variable to your GitLab project CI/CD settings as a "mask variable". This variable holds the private key for the user that will deploy the project from the deployer level. Prepare this `SSH_PRIVATE_KEY`with the following command: `cat privatekey | base64 -w0` and on mac: `cat privatekey | base64 -b0`
8. Define your deployer configuration in your project's `deploy.php` file. Example of a real working configuration:

    ```
