Download the PHP package sourcebroker/deployer-typo3-deploy-ci without Composer

On this page you can find all versions of the php package sourcebroker/deployer-typo3-deploy-ci. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package deployer-typo3-deploy-ci

deployer-typo3-deploy-ci

Packagist License

Contents

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

  1. Install with composer:

  2. Create a file gitlab-ci.yml in the root of your project and put the content below.

    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:

    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:

    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:

    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:

    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:

  9. Push the changes to your repository and see the pipeline at your project.

Stages

Variables

Deployer Tasks

The project uses Deployer for deployment tasks. The configuration files are located in the deployer/default directory.

Own Repo for Overwrites

You may be interested in creating your own repo with values for overwriting variables of sourcebroker/deployer-typo3-deploy-ci.

Good candidates for overwrites are DEPLOY_TRIGGER_BY_CI_COMMIT_BRANCH, DEPLOYER_SELECTOR_FOR_BRANCH, DEPLOYER_SELECTOR_FOR_TAG, FRONTEND_COMMAND_TEST, FRONTEND_COMMAND_BUILD.

Then you should add your remote inclusion in gitlab-ci.yml. Example:

FAQ

  1. How to disable frontend or backend part?

    Example when you would like to have only backend:

Example Configs

Few separate assets with separate build commands

Few separate assets with separate build commands and different node versions


build-frontend-assets3:
  stage: build
  image:
    name: thecodingmachine/php:${PHP}-v4-cli-node18
  retry:
    max: 2
  script:
    - bash -c "cd vendor/my_company/my_ext/Resources/Private/Assets && npm ci && npm run prod"
  artifacts:
    paths:
      - public/assets/frontend/build-assets3
    expire_in: 15 min
  rules:
    - if: $CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH =~ $DEPLOY_TRIGGER_BY_CI_COMMIT_BRANCH
    - if: $CI_COMMIT_TAG && $CI_COMMIT_TAG =~ $DEPLOY_TRIGGER_BY_CI_COMMIT_TAG

deploy:
  needs:
    - job: test-frontend
    - job: test-backend
    - job: build-frontend
    - job: build-backend
    - job: build-frontend-assets3

All versions of deployer-typo3-deploy-ci with dependencies

PHP Build Version
Package Version
Requires deployer/deployer Version ~7.0 || dev-master
sourcebroker/deployer-loader Version ^5 || dev-master
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sourcebroker/deployer-typo3-deploy-ci contains the following files

Loading the files please wait ...