├── .ddev ├── commands │ └── web │ │ └── dependencies-tags-update └── config.yaml ├── .gitignore ├── CHANGELOG.rst ├── LICENSE.txt ├── README.rst ├── UPGRADE.rst ├── composer.json ├── config └── loader.php └── deployer ├── set.php └── task └── deploy.php /.ddev/commands/web/dependencies-tags-update: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ## Description: Update the dependencies tags to latest versions. 4 | ## Usage: dependencies-tags-update 5 | ## Example: ddev dependencies-tags-update 6 | 7 | GREEN='\033[0;32m' 8 | MAGENTA='\033[0;35m' 9 | NC='\033[0m' 10 | 11 | echo "Latest Repository Tags:" 12 | echo "=======================" 13 | 14 | cd /var/www/html 15 | 16 | GITHUB_TOKEN=${GITHUB_TOKEN:-""} 17 | 18 | PACKAGES=$(jq -r '.require | keys[] | select(startswith("sourcebroker/"))' composer.json) 19 | 20 | TEMP_FILE=$(mktemp) 21 | 22 | cp composer.json "$TEMP_FILE" 23 | 24 | for PACKAGE in $PACKAGES; do 25 | echo -e "\n$PACKAGE:" 26 | 27 | VENDOR=$(echo $PACKAGE | cut -d'/' -f1) 28 | REPO=$(echo $PACKAGE | cut -d'/' -f2) 29 | 30 | if [ -n "$GITHUB_TOKEN" ]; then 31 | TAGS_JSON=$(curl -s -H "User-Agent: Tag-Checker-Script" -H "Authorization: token $GITHUB_TOKEN" "https://api.github.com/repos/$VENDOR/$REPO/tags") 32 | else 33 | TAGS_JSON=$(curl -s -H "User-Agent: Tag-Checker-Script" "https://api.github.com/repos/$VENDOR/$REPO/tags") 34 | fi 35 | 36 | if echo "$TAGS_JSON" | grep -q "API rate limit exceeded"; then 37 | echo " Error: GitHub API rate limit exceeded." 38 | echo " Set GITHUB_TOKEN environment variable to increase limit." 39 | continue 40 | fi 41 | 42 | if echo "$TAGS_JSON" | grep -q "Not Found"; then 43 | echo " Error: Repository not found." 44 | continue 45 | fi 46 | 47 | if command -v jq &> /dev/null; then 48 | TAG_COUNT=$(echo "$TAGS_JSON" | jq '. | length') 49 | 50 | if [ "$TAG_COUNT" -eq 0 ]; then 51 | echo " No tags found" 52 | continue 53 | fi 54 | 55 | LATEST_TAG=$(echo "$TAGS_JSON" | jq -r '.[0].name') 56 | 57 | LATEST_VERSION=${LATEST_TAG#v} 58 | 59 | echo " Latest: $LATEST_TAG" 60 | 61 | CURRENT_VERSION_FULL=$(jq -r ".require[\"$PACKAGE\"]" composer.json) 62 | 63 | DEV_VERSION="" 64 | if [[ "$CURRENT_VERSION_FULL" =~ \|\|[[:space:]]*([^[:space:]]+) ]]; then 65 | DEV_VERSION=" || ${BASH_REMATCH[1]}" 66 | fi 67 | 68 | CURRENT_VERSION=$(echo "$CURRENT_VERSION_FULL" | sed -E 's/ *\|{2} *(dev-[[:alnum:]]+)//' | sed 's/\^//') 69 | 70 | if [ "$CURRENT_VERSION" = "$LATEST_VERSION" ]; then 71 | echo -e " Current: ^$CURRENT_VERSION ${GREEN}(already up to date)${NC}" 72 | else 73 | echo -e " Current: ^$CURRENT_VERSION ${MAGENTA}-> Updating to: ^$LATEST_VERSION${NC}" 74 | 75 | if [[ -n "$DEV_VERSION" ]]; then 76 | jq ".require[\"$PACKAGE\"] = \"^$LATEST_VERSION$DEV_VERSION\"" "$TEMP_FILE" > "$TEMP_FILE.new" && mv "$TEMP_FILE.new" "$TEMP_FILE" 77 | else 78 | jq ".require[\"$PACKAGE\"] = \"^$LATEST_VERSION\"" "$TEMP_FILE" > "$TEMP_FILE.new" && mv "$TEMP_FILE.new" "$TEMP_FILE" 79 | fi 80 | fi 81 | 82 | else 83 | echo " Error: jq is required for this script to function properly" 84 | rm "$TEMP_FILE" 85 | exit 1 86 | fi 87 | done 88 | 89 | if ! diff -q composer.json "$TEMP_FILE" > /dev/null; then 90 | cp "$TEMP_FILE" composer.json 91 | echo -e "\n${MAGENTA}Composer.json has been updated with the latest package versions.${NC}" 92 | else 93 | echo -e "\n${GREEN}No updates needed, all packages are already on their latest versions.${NC}" 94 | fi 95 | 96 | rm "$TEMP_FILE" 97 | 98 | echo -e "\nNote: To increase GitHub API request limit, set the GITHUB_TOKEN environment variable." -------------------------------------------------------------------------------- /.ddev/config.yaml: -------------------------------------------------------------------------------- 1 | name: deployer-extended-typo3 2 | type: php 3 | docroot: "" 4 | php_version: "7.4" 5 | webserver_type: nginx-fpm 6 | router_http_port: "80" 7 | router_https_port: "443" 8 | xdebug_enabled: false 9 | additional_hostnames: [] 10 | additional_fqdns: [] 11 | database: 12 | type: mariadb 13 | version: "10.4" 14 | omit_containers: [db, ddev-ssh-agent] 15 | use_dns_when_possible: true 16 | composer_version: "2" 17 | web_environment: [] 18 | 19 | # Key features of DDEV's config.yaml: 20 | 21 | # name: # Name of the project, automatically provides 22 | # http://projectname.ddev.site and https://projectname.ddev.site 23 | 24 | # type: # backdrop, craftcms, django4, drupal6/7/8/9/10, laravel, magento, magento2, php, python, shopware6, silverstripe, typo3, wordpress 25 | # See https://ddev.readthedocs.io/en/latest/users/quickstart/ for more 26 | # information on the different project types 27 | 28 | # docroot: # Relative path to the directory containing index.php. 29 | 30 | # php_version: "8.1" # PHP version to use, "5.6", "7.0", "7.1", "7.2", "7.3", "7.4", "8.0", "8.1", "8.2", "8.3" 31 | 32 | # You can explicitly specify the webimage but this 33 | # is not recommended, as the images are often closely tied to DDEV's' behavior, 34 | # so this can break upgrades. 35 | 36 | # webimage: # nginx/php docker image. 37 | 38 | # database: 39 | # type: # mysql, mariadb, postgres 40 | # version: # database version, like "10.4" or "8.0" 41 | # MariaDB versions can be 5.5-10.8 and 10.11, MySQL versions can be 5.5-8.0 42 | # PostgreSQL versions can be 9-16. 43 | 44 | # router_http_port: # Port to be used for http (defaults to global configuration, usually 80) 45 | # router_https_port: # Port for https (defaults to global configuration, usually 443) 46 | 47 | # xdebug_enabled: false # Set to true to enable Xdebug and "ddev start" or "ddev restart" 48 | # Note that for most people the commands 49 | # "ddev xdebug" to enable Xdebug and "ddev xdebug off" to disable it work better, 50 | # as leaving Xdebug enabled all the time is a big performance hit. 51 | 52 | # xhprof_enabled: false # Set to true to enable Xhprof and "ddev start" or "ddev restart" 53 | # Note that for most people the commands 54 | # "ddev xhprof" to enable Xhprof and "ddev xhprof off" to disable it work better, 55 | # as leaving Xhprof enabled all the time is a big performance hit. 56 | 57 | # webserver_type: nginx-fpm, apache-fpm, or nginx-gunicorn 58 | 59 | # timezone: Europe/Berlin 60 | # This is the timezone used in the containers and by PHP; 61 | # it can be set to any valid timezone, 62 | # see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones 63 | # For example Europe/Dublin or MST7MDT 64 | 65 | # composer_root: 66 | # Relative path to the Composer root directory from the project root. This is 67 | # the directory which contains the composer.json and where all Composer related 68 | # commands are executed. 69 | 70 | # composer_version: "2" 71 | # You can set it to "" or "2" (default) for Composer v2 or "1" for Composer v1 72 | # to use the latest major version available at the time your container is built. 73 | # It is also possible to use each other Composer version channel. This includes: 74 | # - 2.2 (latest Composer LTS version) 75 | # - stable 76 | # - preview 77 | # - snapshot 78 | # Alternatively, an explicit Composer version may be specified, for example "2.2.18". 79 | # To reinstall Composer after the image was built, run "ddev debug refresh". 80 | 81 | # nodejs_version: "18" 82 | # change from the default system Node.js version to any other version. 83 | # Numeric version numbers can be complete (i.e. 18.15.0) or 84 | # incomplete (18, 17.2, 16). 'lts' and 'latest' can be used as well along with 85 | # other named releases. 86 | # see https://www.npmjs.com/package/n#specifying-nodejs-versions 87 | # Note that you can continue using 'ddev nvm' or nvm inside the web container 88 | # to change the project's installed node version if you need to. 89 | 90 | # additional_hostnames: 91 | # - somename 92 | # - someothername 93 | # would provide http and https URLs for "somename.ddev.site" 94 | # and "someothername.ddev.site". 95 | 96 | # additional_fqdns: 97 | # - example.com 98 | # - sub1.example.com 99 | # would provide http and https URLs for "example.com" and "sub1.example.com" 100 | # Please take care with this because it can cause great confusion. 101 | 102 | # upload_dirs: "custom/upload/dir" 103 | # 104 | # upload_dirs: 105 | # - custom/upload/dir 106 | # - ../private 107 | # 108 | # would set the destination paths for ddev import-files to /custom/upload/dir 109 | # When Mutagen is enabled this path is bind-mounted so that all the files 110 | # in the upload_dirs don't have to be synced into Mutagen. 111 | 112 | # disable_upload_dirs_warning: false 113 | # If true, turns off the normal warning that says 114 | # "You have Mutagen enabled and your 'php' project type doesn't have upload_dirs set" 115 | 116 | # ddev_version_constraint: "" 117 | # Example: 118 | # ddev_version_constraint: ">= 1.22.4" 119 | # This will enforce that the running ddev version is within this constraint. 120 | # See https://github.com/Masterminds/semver#checking-version-constraints for 121 | # supported constraint formats 122 | 123 | # working_dir: 124 | # web: /var/www/html 125 | # db: /home 126 | # would set the default working directory for the web and db services. 127 | # These values specify the destination directory for ddev ssh and the 128 | # directory in which commands passed into ddev exec are run. 129 | 130 | # omit_containers: [db, ddev-ssh-agent] 131 | # Currently only these containers are supported. Some containers can also be 132 | # omitted globally in the ~/.ddev/global_config.yaml. Note that if you omit 133 | # the "db" container, several standard features of DDEV that access the 134 | # database container will be unusable. In the global configuration it is also 135 | # possible to omit ddev-router, but not here. 136 | 137 | # performance_mode: "global" 138 | # DDEV offers performance optimization strategies to improve the filesystem 139 | # performance depending on your host system. Should be configured globally. 140 | # 141 | # If set, will override the global config. Possible values are: 142 | # - "global": uses the value from the global config. 143 | # - "none": disables performance optimization for this project. 144 | # - "mutagen": enables Mutagen for this project. 145 | # - "nfs": enables NFS for this project. 146 | # 147 | # See https://ddev.readthedocs.io/en/latest/users/install/performance/#nfs 148 | # See https://ddev.readthedocs.io/en/latest/users/install/performance/#mutagen 149 | 150 | # fail_on_hook_fail: False 151 | # Decide whether 'ddev start' should be interrupted by a failing hook 152 | 153 | # host_https_port: "59002" 154 | # The host port binding for https can be explicitly specified. It is 155 | # dynamic unless otherwise specified. 156 | # This is not used by most people, most people use the *router* instead 157 | # of the localhost port. 158 | 159 | # host_webserver_port: "59001" 160 | # The host port binding for the ddev-webserver can be explicitly specified. It is 161 | # dynamic unless otherwise specified. 162 | # This is not used by most people, most people use the *router* instead 163 | # of the localhost port. 164 | 165 | # host_db_port: "59002" 166 | # The host port binding for the ddev-dbserver can be explicitly specified. It is dynamic 167 | # unless explicitly specified. 168 | 169 | # mailpit_http_port: "8025" 170 | # mailpit_https_port: "8026" 171 | # The Mailpit ports can be changed from the default 8025 and 8026 172 | 173 | # host_mailpit_port: "8025" 174 | # The mailpit port is not normally bound on the host at all, instead being routed 175 | # through ddev-router, but it can be bound directly to localhost if specified here. 176 | 177 | # webimage_extra_packages: [php7.4-tidy, php-bcmath] 178 | # Extra Debian packages that are needed in the webimage can be added here 179 | 180 | # dbimage_extra_packages: [telnet,netcat] 181 | # Extra Debian packages that are needed in the dbimage can be added here 182 | 183 | # use_dns_when_possible: true 184 | # If the host has internet access and the domain configured can 185 | # successfully be looked up, DNS will be used for hostname resolution 186 | # instead of editing /etc/hosts 187 | # Defaults to true 188 | 189 | # project_tld: ddev.site 190 | # The top-level domain used for project URLs 191 | # The default "ddev.site" allows DNS lookup via a wildcard 192 | # If you prefer you can change this to "ddev.local" to preserve 193 | # pre-v1.9 behavior. 194 | 195 | # ngrok_args: --basic-auth username:pass1234 196 | # Provide extra flags to the "ngrok http" command, see 197 | # https://ngrok.com/docs/ngrok-agent/config or run "ngrok http -h" 198 | 199 | # disable_settings_management: false 200 | # If true, DDEV will not create CMS-specific settings files like 201 | # Drupal's settings.php/settings.ddev.php or TYPO3's AdditionalConfiguration.php 202 | # In this case the user must provide all such settings. 203 | 204 | # You can inject environment variables into the web container with: 205 | # web_environment: 206 | # - SOMEENV=somevalue 207 | # - SOMEOTHERENV=someothervalue 208 | 209 | # no_project_mount: false 210 | # (Experimental) If true, DDEV will not mount the project into the web container; 211 | # the user is responsible for mounting it manually or via a script. 212 | # This is to enable experimentation with alternate file mounting strategies. 213 | # For advanced users only! 214 | 215 | # bind_all_interfaces: false 216 | # If true, host ports will be bound on all network interfaces, 217 | # not the localhost interface only. This means that ports 218 | # will be available on the local network if the host firewall 219 | # allows it. 220 | 221 | # default_container_timeout: 120 222 | # The default time that DDEV waits for all containers to become ready can be increased from 223 | # the default 120. This helps in importing huge databases, for example. 224 | 225 | #web_extra_exposed_ports: 226 | #- name: nodejs 227 | # container_port: 3000 228 | # http_port: 2999 229 | # https_port: 3000 230 | #- name: something 231 | # container_port: 4000 232 | # https_port: 4000 233 | # http_port: 3999 234 | # Allows a set of extra ports to be exposed via ddev-router 235 | # Fill in all three fields even if you don’t intend to use the https_port! 236 | # If you don’t add https_port, then it defaults to 0 and ddev-router will fail to start. 237 | # 238 | # The port behavior on the ddev-webserver must be arranged separately, for example 239 | # using web_extra_daemons. 240 | # For example, with a web app on port 3000 inside the container, this config would 241 | # expose that web app on https://.ddev.site:9999 and http://.ddev.site:9998 242 | # web_extra_exposed_ports: 243 | # - name: myapp 244 | # container_port: 3000 245 | # http_port: 9998 246 | # https_port: 9999 247 | 248 | #web_extra_daemons: 249 | #- name: "http-1" 250 | # command: "/var/www/html/node_modules/.bin/http-server -p 3000" 251 | # directory: /var/www/html 252 | #- name: "http-2" 253 | # command: "/var/www/html/node_modules/.bin/http-server /var/www/html/sub -p 3000" 254 | # directory: /var/www/html 255 | 256 | # override_config: false 257 | # By default, config.*.yaml files are *merged* into the configuration 258 | # But this means that some things can't be overridden 259 | # For example, if you have 'use_dns_when_possible: true'' you can't override it with a merge 260 | # and you can't erase existing hooks or all environment variables. 261 | # However, with "override_config: true" in a particular config.*.yaml file, 262 | # 'use_dns_when_possible: false' can override the existing values, and 263 | # hooks: 264 | # post-start: [] 265 | # or 266 | # web_environment: [] 267 | # or 268 | # additional_hostnames: [] 269 | # can have their intended affect. 'override_config' affects only behavior of the 270 | # config.*.yaml file it exists in. 271 | 272 | # Many DDEV commands can be extended to run tasks before or after the 273 | # DDEV command is executed, for example "post-start", "post-import-db", 274 | # "pre-composer", "post-composer" 275 | # See https://ddev.readthedocs.io/en/stable/users/extend/custom-commands/ for more 276 | # information on the commands that can be extended and the tasks you can define 277 | # for them. Example: 278 | #hooks: 279 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.Build 2 | /composer.lock -------------------------------------------------------------------------------- /CHANGELOG.rst: -------------------------------------------------------------------------------- 1 | 2 | Changelog 3 | --------- 4 | 5 | 24.0.0 6 | ~~~~~~ 7 | 8 | 1) [TASK][BREAKING] Drop support for TYPO3 8,9,10,11. 9 | 2) [TASK][BREAKING] Remove dependency to ``helhum/dotenv-connector``, ``helhum/typo3-console``. Remove direct dependency to ``symfony/dotenv``. 10 | 3) [TASK][BREAKING] Change ``deploy`` task flow. 11 | 4) [TASK][BREAKING] Remove ``deploy-fast`` task (new flow is by default the same as was deploy-fast) 12 | 5) [TASK][BREAKING] Change ``shared_dirs``, ``writable_dirs`` to reflect TYPO3 12+. 13 | 6) [TASK][BREAKING] Force ``writable_mode`` to ``skip`` by default (assume ssh user is fully compatible with httpd user) 14 | 7) [TASK][BREAKING] Rename ``bin/typo3cms`` to ``bin/typo3``. 15 | 8) [TASK][BREAKING] Exclude ``composer.json`` and ``composer.lock`` from ``clear_path``. 16 | 9) [TASK][BREAKING] Drop task ``config:createadmin``. 17 | 10) [TASK][BREAKING] Move base settings and base functionality specific to database sync, media sync and deploy to new packages 18 | ``sourcebroker/deployer-typo3-deploy``, ``sourcebroker/deployer-typo3-deploy-ci``, ``sourcebroker/deployer-typo3-database``, 19 | ``sourcebroker/deployer-typo3-media``. Require those packages as dependency. 20 | 11) [TASK] Update dependency to ``sourcebroker/deployer-extended``. 21 | 12) [TASK] Add ddev command to update dependencies. 22 | 13) [TASK] Update dependencies to stable versions of ``sourcebroker/deployer-typo3-*``. 23 | 24 | 23.0.0 25 | ------ 26 | 27 | 1) [TASK][BREAKING] Update ``sourcebroker/deployer-instance``, ``sourcebroker/deployer-extended``, ``sourcebroker/deployer-extended-media``, 28 | ``sourcebroker/deployer-extended-database``, ``sourcebroker/deployer-loader``. Remove buffer tasks from deploy as they were removed in 29 | ``sourcebroker/deployer-extended`` 20.0.0. Last release for ``sourcebroker/deployer-extended-typo3`` in old flow. 30 | 31 | 22.0.0 32 | ------ 33 | 34 | 1) [BREAKING] Update ``deployer-extended-database`` to 18.0.0. Fixes issue with ``MYSQL_PWD`` overwritten by ``.my.conf``. 35 | https://github.com/sourcebroker/deployer-extended-database/issues/33 36 | 2) [TASK] Increase dependency of ``symfony/dotenv`` to 7. 37 | 38 | 21.0.0 39 | ~~~~~~ 40 | 41 | 1) [TASK][BREAKING] Drop support for TYPO3 7. 42 | 2) [TASK] Make Typo3CmsDriver to use ``local/bin/php`` and ``local/bin/typo3cms`` vars. 43 | 3) [TASK] Merge the same configs for TYPO3 10-12. 44 | 4) [BUGFIX] Fix typo3-console binary. 45 | 5) [TASK] Drop support for helhum/dotenv-connector 1, helhum/typo3-console 4. Add dev-master for all for easier testing. 46 | 6) [TASK] Add "typo" alias "dpeloy" for "deploy". 47 | 7) [TASK] Add "phpcs.xml" to "clear_paths". 48 | 8) [TASK] Update deployer-extended-database to 17. 49 | 9) [TASK] Update deployer-extended-media to 12. 50 | 10) [TASK] For ``driver_typo3cms`` allows to get ``local/bin/php`` and ``local/bin/typo3cms`` from host config and not 51 | only from global config. 52 | 11) [FEATURE] Update ``deployer-extended`` to 19 and add task ``deploy:check_composer_validate`` 53 | to ``deploy`` and ``deploy-fast``. 54 | 55 | 20.0.0 56 | ~~~~~~ 57 | 58 | 1) [TASK][BREAKING] Refactor for Deployer 7 compatibility. See UPGRADE.rst for more info. 59 | 60 | 2) [TASK][BREAKING] Drop support for TYPO3 6.2. 61 | 62 | 3) [TASK] Bring back 'keep_releases' set to 5 as it was in Deployer 6 (in Deployer 7 it is set to 10). 63 | 64 | 65 | 19.0.0 66 | ~~~~~~ 67 | 68 | 1) [TASK][BREAKING] Set ``set('web_path', 'public/');`` and ``set('composer_channel', 2);`` by default for TYPO3 10+. 69 | 2) [TASK][BREAKING] Extend the ``clear_paths`` list. 70 | 3) [TASK] Allow ``driver_typo3cms`` to be used with v9. 71 | 4) [TASK][BREAKING] Update dependency to ``sourcebroker/deployer-loader`` which introduce load folder/files alphabetically. 72 | 5) [TASK][BREAKING] Update dependency to ``sourcebroker/deployer-extended-database``, ``sourcebroker/deployer-extended-media`` 73 | due to ``sourcebroker/deployer-loader`` update. 74 | 75 | 18.1.0 76 | ~~~~~~ 77 | 78 | 1) [FEATURE] Add path ``vendor/typo3/cms-core/Documentation/Changelog-*.rst`` for TYPO3 version detection to 79 | have compatibility with ``typo3/cms-composer-installers`` 4+. 80 | 81 | 2) [TASK] Optimise method projectRootAbsolutePath. 82 | 83 | 18.0.0 84 | ~~~~~~ 85 | 86 | 1) [TASK][BREAKING] Possible breaking because it changes the way it detects TYPO3 version. 87 | Now its doing ``glob($rootDir . '/typo3/sysext/core/Documentation/Changelog-*.rst');`` and 88 | ``glob($rootDir . '/*/typo3/sysext/core/Documentation/Changelog-*.rst');`` and choose the 89 | highest number from the Changelogs files. The possible fail can be when you store second TYPO3 90 | sources with different version in the same root. 91 | 92 | 17.0.0 93 | ~~~~~~ 94 | 95 | 1) [TASK][BREAKING] Possible breaking change because extends ``typo3_console`` to 7.0. 96 | Can break flows that depends on ``typo3cms install:generatepackagestates``. 97 | 98 | 16.1.0 99 | ~~~~~~ 100 | 101 | 1) [TASK] Add support for TYPO3 11 102 | 2) [TASK] Cleanup on clear_paths and add ``.php-cs-fixer.php``. 103 | 3) [FEATURE] Add support for alternative way of reading database access data from TYPO3 to be used in deployer. The new 104 | Typo3CmsDriver driver is using command ``./vendor/bin/typo3cms configuration:showactive DB --json`` to read database d 105 | data so its independent on the way how you pass the database data for TYPO3. You need to activate it with 106 | ``set('driver_typo3cms', true);`` in your ``deploy.php`` file. 107 | 4) [FEATURE] Add ``typo3cms:language:update`` task for those who update language files on each deploy. 108 | 109 | 16.0.0 110 | ~~~~~~ 111 | 112 | 1) [TASK][BREAKING] Update to ``sourcebroker/deployer-extended`` which overwrites ``bin/composer``. It allows to set 113 | ``composer_channel`` or ``composer_version``. 114 | 115 | 15.0.0 116 | ~~~~~~ 117 | 118 | 1) [BUGFIX] Fix compatibility with symfony/dotenv 5.0 which do not use getenv() by default. 119 | 2) [TASK] Add ddev config. 120 | 3) [TASK][BREAKING] Remove auto creation of .env and database. Use ``https://ddev.readthedocs.io/en/stable/`` or similar 121 | tool instead. 122 | 4) [TASK][BREAKING] Change public method getDatabaseConfig() in class Typo3EnvDriver. The second parameter 123 | ``$absolutePathWithConfig`` was directory folder with .env file. Now the second parameter is path to file itself. 124 | 5) [TASK][BREAKING] Update ``sourcebroker/deployer-extended``, ``sourcebroker/deployer-extended-media``, 125 | ``sourcebroker/deployer-extended-database``. 126 | 127 | 14.1.0 128 | ~~~~~~ 129 | 130 | 1) [TASK] Increase ``helhum/dotenv-connector`` version. 131 | 132 | 14.0.0 133 | ~~~~~~ 134 | 135 | 1) [TASK] Add ``.ddev`` to ``clear_paths``. 136 | 2) [TASK] Increase ``deployer/dist`` version. 137 | 3) [BREAKING] Increase dependency to breaking version of ``sourcebroker/deployer-extended-database`` 138 | 139 | 13.1.0 140 | ~~~~~~ 141 | 142 | 1) [TASK] Support for ddev database settings. 143 | 144 | 13.0.0 145 | ~~~~~~ 146 | 147 | 1) [TASK] Increase dependency for TYPO3 10. 148 | 2) [TASK] Refactor TYPO3 version detection. 149 | 3) [TASK][BREAKING] Refactor placement of configuration per TYPO3 version and add ``var/transient`` to shared dirs. 150 | 4) [TASK][BREAKING] Increase deployer version, increase typo3_console version, increase deployer-extended version. 151 | 152 | 12.1.0 153 | ~~~~~~ 154 | 155 | 1) [TASK] Add ``web_path`` support to allow DocumentRoot in different folder. 156 | 2) [TASK] Anonymous function for ``web_path`` parts to allow to set ``web_path`` later. 157 | 3) [BUGFIX] Fix wrong share dir for logs folder. 158 | 159 | 12.0.0 160 | ~~~~~~ 161 | 162 | 1) [TASK][BREAKING] Add auto unlock after deploy:failed 163 | 2) [TASK][BREAKING] Add task deploy:check_branch_local to deploy path. 164 | 3) [TASK] Increase default_timeout from 300s to 900s. 165 | 4) [TASK][BREAKING] Refactor config:createadmin to support new var naming from deployer-instance 166 | 5) [TASK][BREAKING] Deny pushing, copying, pulling media and database to top instance live. 167 | 6) [TASK][BREAKING] Update deployer\-extended-media, deployer-extended-database, deployer-instance, deployer-extended. 168 | 7) [TASK][BREAKING] By setting ``set('branch_detect_to_deploy', false);`` change the default unsafe bahaviour of deployer to 169 | deploy the currently checked out up branch. The branch must be set explicitly in host configuration. 170 | 171 | 11.0.0 172 | ~~~~~~ 173 | 174 | 1) [BUGFIX] Fix use of SourceBroker\DeployerExtendedDatabase\Utility\ConsoleUtility in task config:createadmin. 175 | 2) [FEATURE][BREAKING] Extend set of not needed root files to cleanup on deploy. 176 | 3) [BUGFIX][BREAKING] Fix typo in env name - DET_CONFIG_CREATEADMIN_USERNAME to DEP_CONFIG_CREATEADMIN_USERNAME. 177 | 178 | 10.0.0 179 | ~~~~~~ 180 | 181 | 1) [TASK] Add deploy:check_branch, deploy:info, deploy:log_extend tasks to deploy. 182 | 2) [TASK][BREAKING] Remove deployer-bulk-tasks dependency. Add database:updateschema task. 183 | 3) [TASK][BREAKING] Update database synchro config for TYPO3 9. 184 | 185 | 9.0.0 186 | ~~~~~ 187 | 188 | 1) [TASK][BREAKING] Add sourcebroker/deployer-instance for instance vars management. 189 | 2) [FEATURE] Add task "config:createadmin" for creating TYPO3 admin user. 190 | 3) [BUGFIX] Remove colon from file names because if Windows compatibility. 191 | 4) [TASK] Remove not direct dependency. 192 | 5) [TASK] Normalize use of dots at the end of task description. 193 | 194 | 8.0.0 195 | ~~~~~ 196 | 197 | 1) [TASK][BREAKING] Make typo3_console sem versioning more open. 198 | 199 | 7.1.0 200 | ~~~~~ 201 | 202 | 1) [BUGFIX] If repo name has dots the database can not be auto created. 203 | 2) [TASK] Replace dots and dashes in database name to underscores to have more safe database name. 204 | 205 | 7.0.1 206 | ~~~~~ 207 | 208 | 1) [BUGFIX] The "typo3cms database:updateschema" without additional parameters in not available in typo3_console 209 | that can be installed in TYPO3 6.2. Therefore separate task is needed for TYPO3 6.2. 210 | 211 | 212 | 7.0.0 213 | ~~~~~ 214 | 215 | 1) [TASK][BREAKING] Modify default deploy task. 216 | 2) [TASK] Add "deploy-fast" task without database and buffer protections - good to deploy to staging instances. 217 | 3) [TASK][BREAKING] Increase verisons of sourcebroker/deployer-extended, sourcebroker/deployer-extended-media, 218 | sourcebroker/deployer-extended-database. 219 | 220 | 6.2.1 221 | ~~~~~ 222 | 223 | 1) [BUGFIX] Fix database creation statement to allow all chars. 224 | 225 | 6.2.0 226 | ~~~~~ 227 | 228 | 1) [TASK] Increase helhum/typo3-console dependency to 5.5.0 229 | 2) [TASK] Set helhum/dotenv-connector to ~2.1.0 for better stability. 230 | 231 | 232 | 6.1.0 233 | ~~~~~ 234 | 235 | 1) [TASK] Make dependency to helhum/dotenv-connector more open. 236 | 237 | 6.0.1 238 | ~~~~~ 239 | 240 | 1) [BUGFIX] Remove dependency from FileUtility. 241 | 242 | 6.0.0 243 | ~~~~~ 244 | 245 | 1) [TASK] Add ssh_type and ssh_multiplexing (It was removed from package "deployer-extended" to higher level package 246 | like this one). 247 | 2) [FEATURE] .env file autocreate. 248 | 3) [DOCS] Docs cleanup. 249 | 250 | 5.2.0 251 | ~~~~~ 252 | 253 | 1) [FEATURE] CMS and vendors to to .Build. 254 | 255 | 5.1.0 256 | ~~~~~ 257 | 258 | 1) [FEATURE] Add support for typo3_console 5.0.0 259 | 260 | 5.0.1 261 | ~~~~~ 262 | 263 | 1) [BUGFIX] Add missing binary to bulk_tasks. 264 | 265 | 5.0.0 266 | ~~~~~ 267 | 268 | 1) [BREAKING] First version of unified implementation - one code to support all version of TYPO3. 269 | 2) [DOCS] Docs update. 270 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright © 2025 SourceBroker Team 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.rst: -------------------------------------------------------------------------------- 1 | deployer-extended-typo3 2 | ======================= 3 | 4 | .. image:: http://img.shields.io/packagist/v/sourcebroker/deployer-extended-typo3.svg?style=flat 5 | :target: https://packagist.org/packages/sourcebroker/deployer-extended-typo3 6 | 7 | .. image:: https://img.shields.io/badge/license-MIT-blue.svg?style=flat 8 | :target: https://packagist.org/packages/sourcebroker/deployer-extended-typo3 9 | 10 | .. contents:: :local: 11 | 12 | What does it do? 13 | ---------------- 14 | 15 | This package is customisation for stack of packages ``sourcebroker/deployer-typo3-*``. 16 | 17 | 1) package `sourcebroker/deployer-typo3-deploy`_ - TYPO3 deploy process at local level 18 | 2) package `sourcebroker/deployer-typo3-deploy-ci`_ TYPO3 deploy process at CI level (gitlab for now only) 19 | 3) package `sourcebroker/deployer-typo3-database`_ TYPO3 preconfigured synchronisation of databases between multiple instances 20 | 4) package `sourcebroker/deployer-typo3-media`_ TYPO3 preconfigured synchronisation of media between multiple instances 21 | 22 | You should treat this package more like example and fork it to make your own customisation. 23 | 24 | But if you accept flow proposed by this project then of course you can make it a base for your projects. 25 | 26 | 27 | Installation 28 | ------------ 29 | 30 | 1) Install package with composer: 31 | :: 32 | 33 | composer require sourcebroker/deployer-extended-typo3 34 | 35 | 2) Put following lines on the beginning of your ``deploy.php``. You can decide what packages/functionality you want to use. 36 | For example - remove line ``['get' => 'sourcebroker/deployer-typo3-database'],`` and there will be no task for database sync. 37 | If you choose deploy using CI then use ``sourcebroker/deployer-typo3-deploy-ci`` instead of ``sourcebroker/deployer-typo3-deploy``. 38 | Each package is completely independent and you can use only those you need. 39 | 40 | :: 41 | 42 | 'sourcebroker/deployer-typo3-media'], 48 | ['get' => 'sourcebroker/deployer-typo3-database'], 49 | ['get' => 'sourcebroker/deployer-typo3-deploy'], 50 | ['get' => 'sourcebroker/deployer-extended-typo3'], 51 | ]); 52 | 53 | 3) If you use `sourcebroker/deployer-typo3-deploy`_ then remove task ``deploy`` from your ``deploy.php``. 54 | 55 | 4) If you want to use database synchronisation then please read documentation at `sourcebroker/deployer-typo3-database`_ 56 | 57 | 5) If you want to use media synchronisation then please read documentation at `sourcebroker/deployer-typo3-media`_ 58 | 59 | 60 | Example of working configuration 61 | -------------------------------- 62 | 63 | This is example of working configuration for TYPO3 13. The aim of ``sourcebroker/deployer-extended-typo3`` is to 64 | have very slim ``deploy.php`` file in order to have nice possibility to upgrade to future versions of 65 | ``sourcebroker/deployer-extended-typo3``. 66 | 67 | This is config for deploy from local cli level. 68 | 69 | :: 70 | 71 | 'sourcebroker/deployer-typo3-media'], 79 | ['get' => 'sourcebroker/deployer-typo3-database'], 80 | ['get' => 'sourcebroker/deployer-typo3-deploy'], 81 | ['get' => 'sourcebroker/deployer-extended-typo3'], 82 | ]); 83 | 84 | set('repository', 'git@github.com:sourcebrokergit/t3base13.git'); 85 | 86 | host('production') 87 | ->setHostname('vm-dev.example.com') 88 | ->setRemoteUser('deploy') 89 | ->set('branch', 'main') 90 | ->set('public_urls', ['https://t3base13.example.com']) 91 | ->set('deploy_path', '~/t3base13/production'); 92 | 93 | host('staging') 94 | ->setHostname('vm-dev.example.com') 95 | ->setRemoteUser('deploy') 96 | ->set('branch', 'develop') 97 | ->set('public_urls', ['https://staging-t3base13.example.com']) 98 | ->set('deploy_path', '~/t3base13/staging'); 99 | 100 | and here example for deploy from gitlab ci. Deploy is from CI level but database and media synchro still needs ssh access (!) 101 | 102 | :: 103 | 104 | 'sourcebroker/deployer-typo3-media'], 112 | ['get' => 'sourcebroker/deployer-typo3-database'], 113 | ['get' => 'sourcebroker/deployer-typo3-deploy-ci'], 114 | ['get' => 'sourcebroker/deployer-extended-typo3'], 115 | ]); 116 | 117 | host('production') 118 | ->setHostname('vm-dev.example.com') 119 | ->setRemoteUser('deploy') 120 | ->set('public_urls', ['https://t3base13.example.com']) 121 | ->set('deploy_path', '~/t3base13/production'); 122 | 123 | host('staging') 124 | ->setHostname('vm-dev.example.com') 125 | ->setRemoteUser('deploy') 126 | ->set('public_urls', ['https://staging-t3base13.example.com']) 127 | ->set('deploy_path', '~/t3base13/staging'); 128 | 129 | 130 | Changelog 131 | --------- 132 | 133 | See https://github.com/sourcebroker/deployer-extended-typo3/blob/master/CHANGELOG.rst 134 | 135 | .. _sourcebroker/deployer-typo3-deploy: https://github.com/sourcebroker/deployer-typo3-deploy 136 | .. _sourcebroker/deployer-typo3-deploy-ci: https://github.com/sourcebroker/deployer-typo3-deploy-ci 137 | .. _sourcebroker/deployer-typo3-database: https://github.com/sourcebroker/deployer-typo3-database 138 | .. _sourcebroker/deployer-typo3-media: https://github.com/sourcebroker/deployer-typo3-media 139 | -------------------------------------------------------------------------------- /UPGRADE.rst: -------------------------------------------------------------------------------- 1 | 2 | Changelog 3 | --------- 4 | 5 | 20.0.0 -> 24.0.0 6 | ~~~~~~~~~~~~~~~~ 7 | 8 | The scope of changes to base code is big but for most cases you should only remove the old loader from ``deploy.php``: 9 | 10 | :: 11 | 12 | require_once(__DIR__ . '/vendor/sourcebroker/deployer-loader/autoload.php'); 13 | new \SourceBroker\DeployerExtendedTypo3\Loader(); 14 | 15 | and replace it with new package loading. 16 | 17 | :: 18 | 19 | require_once('./vendor/autoload.php'); 20 | 21 | new \SourceBroker\DeployerLoader\Load([ 22 | ['get' => 'sourcebroker/deployer-typo3-media'], 23 | ['get' => 'sourcebroker/deployer-typo3-database'], 24 | ['get' => 'sourcebroker/deployer-typo3-deploy'], 25 | ['get' => 'sourcebroker/deployer-extended-typo3'], 26 | ]); 27 | 28 | For most cases you can also remove ``bin/php`` from your host definitions because it is now detected automatically 29 | based on PHP version in composer.json. There is however condition that ``phpXY`` or ``phpX.Y`` is available in PATH 30 | at host. Not all hosters deliver this unfortunately. 31 | 32 | 19.0.0 -> 20.0.0 33 | ~~~~~~~~~~~~~~~~ 34 | 35 | 1) You need now to have composer.json in root directory. 36 | 37 | 2) Task ``deploy:extend_log`` has been removed in favor of such same task build in in Deployer 7. 38 | File ``.dep/releases.extended`` with additional info can be removed. 39 | 40 | 3) If you were modifying ``db_databases`` on host level with ``array_merge_recursive`` and in ``db_databases`` there 41 | were some closures then since Deployer 7 this will no longer work. You can get the same result when using 42 | ``db_databases_overwrite``. You can also use ``db_databases_overwrite_global`` to overwrite with similar way on 43 | global level. 44 | 45 | :: 46 | 47 | OLD 48 | 49 | host('local') 50 | ->set('deploy_path', getcwd()) 51 | ->set('db_databases', array_merge_recursive(get('db_databases'), 52 | [ 53 | 'database_default' => 54 | [ 55 | [ 56 | 'post_sql_in' => 57 | ' 58 | UPDATE table ..... 59 | ' 60 | ] 61 | ] 62 | ])); 63 | 64 | 65 | 66 | NEW 67 | 68 | host('local') 69 | ->set('deploy_path', getcwd()) 70 | ->set('db_databases_overwrite', 71 | [ 72 | 'database_default' => 73 | [ 74 | [ 75 | 'post_sql_in' => 76 | ' 77 | UPDATE table ..... 78 | ' 79 | ] 80 | ] 81 | ]); 82 | 83 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sourcebroker/deployer-extended-typo3", 3 | "description": "Customisation for `sourcebroker/deployer-typo3-*` stack", 4 | "license": "MIT", 5 | "keywords": [ 6 | "TYPO3", 7 | "deployer" 8 | ], 9 | "require": { 10 | "sourcebroker/deployer-typo3-deploy": "^1.0.0 || dev-main", 11 | "sourcebroker/deployer-typo3-deploy-ci": "^1.0.0 || dev-main", 12 | "sourcebroker/deployer-typo3-database": "^1.0.0 || dev-main", 13 | "sourcebroker/deployer-typo3-media": "^1.0.0 || dev-main", 14 | "sourcebroker/deployer-extended": "^24.0.0 || dev-master" 15 | }, 16 | "authors": [ 17 | { 18 | "name": "Krystian Szymukowicz", 19 | "email": "k.szymukowicz@gmail.com" 20 | } 21 | ], 22 | "extra": { 23 | "typo3/cms": { 24 | "cms-package-dir": "{$vendor-dir}/typo3/cms", 25 | "web-dir": ".Build/Web" 26 | } 27 | }, 28 | "config": { 29 | "sort-packages": true, 30 | "vendor-dir": ".Build/vendor" 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /config/loader.php: -------------------------------------------------------------------------------- 1 | 'sourcebroker/deployer-extended', 7 | ], 8 | [ 9 | // Add custom "bin/composer" where composer version can be chosen and updated. https://github.com/sourcebroker/deployer-extended?tab=readme-ov-file#bincomposer 10 | 'path' => 'vendor/sourcebroker/deployer-extended/includes/settings/bin_composer.php', 11 | ], 12 | [ 13 | // Add custom "bin/php" where php version is detected based on composer.json. https://github.com/sourcebroker/deployer-extended?tab=readme-ov-file#binphp 14 | 'path' => 'vendor/sourcebroker/deployer-extended/includes/settings/bin_php.php', 15 | ], 16 | [ 17 | // Add custom task "releases" which solved performance problems of original deployer "release" task. https://github.com/sourcebroker/deployer-extended?tab=readme-ov-file#releases 18 | 'path' => 'vendor/sourcebroker/deployer-extended/includes/tasks/releases.php', 19 | ], 20 | [ 21 | // Load all from "deployer" folder of "sourcebroker/deployer-extended-typo3" package 22 | 'package' => 'sourcebroker/deployer-extended-typo3', 23 | ], 24 | ]; 25 | -------------------------------------------------------------------------------- /deployer/set.php: -------------------------------------------------------------------------------- 1 | set("branch", "main");` or by adding cli param `--branch=` 25 | # If branch is not set the task "deploy:check_branch_local" will stop deploy. 26 | set('branch', function () { 27 | return null; 28 | }); 29 | 30 | // Do not allow dangerous media sync to top instances. 31 | // Look https://github.com/sourcebroker/deployer-extended-media for docs 32 | set('media_allow_push_live', false); 33 | set('media_allow_copy_live', false); 34 | set('media_allow_link_live', false); 35 | set('media_allow_pull_live', false); 36 | 37 | // Do not allow dangerous database sync to top instances. 38 | // Look https://github.com/sourcebroker/deployer-extended-database for docs 39 | set('db_allow_push_live', false); 40 | set('db_allow_pull_live', false); 41 | set('db_allow_copy_live', false); 42 | 43 | // Set custom database backup rotations 44 | set('db_dumpclean_keep', ['*' => 5, 'live' => 10]); 45 | 46 | // Extend ignore_tables_out defined in sourcebroker/deployer-typo3-database 47 | $dbDefault = get('db_default'); 48 | $dbDefault['ignore_tables_out'] = [ 49 | ...($dbDefault['ignore_tables_out'] ?? []), 50 | 'sys_history', 51 | 'sys_log', 52 | 'tx_powermail_domain_model_mail', 53 | 'tx_powermail_domain_model_answer', 54 | ]; 55 | set('db_default', $dbDefault); 56 | -------------------------------------------------------------------------------- /deployer/task/deploy.php: -------------------------------------------------------------------------------- 1 | tasks->has('deploy-ci')) { 8 | 9 | // sourcebroker/deployer-extended special task. Read more at https://github.com/sourcebroker/deployer-extended#deploy-check-lock 10 | after('deploy:info', 'deploy:check_lock'); 11 | 12 | // sourcebroker/deployer-extended special task. Read more at https://github.com/sourcebroker/deployer-extended#deploy-check-composer-install 13 | after('deploy:info', 'deploy:check_composer_install'); 14 | 15 | // sourcebroker/deployer-extended special task. Read more at https://github.com/sourcebroker/deployer-extended#deploy-check-composer-validate 16 | after('deploy:info', 'deploy:check_composer_validate'); 17 | 18 | // sourcebroker/deployer-extended special task. Read more at https://github.com/sourcebroker/deployer-extended#deploy-check-branch-local 19 | after('deploy:info', 'deploy:check_branch_local'); 20 | 21 | // sourcebroker/deployer-extended special task. Read more at https://github.com/sourcebroker/deployer-extended#deploy-check-branch 22 | after('deploy:info', 'deploy:check_branch'); 23 | } 24 | 25 | // sourcebroker/deployer-extended special task. Read more on https://github.com/sourcebroker/deployer-extended#service-php-fpm-reload 26 | after('deploy:symlink', 'service:php_fpm_reload'); 27 | 28 | // sourcebroker/deployer-extended special task. Read more on https://github.com/sourcebroker/deployer-extended#cache-clear-php-cli 29 | after('deploy:symlink', 'cache:clear_php_cli'); 30 | 31 | // sourcebroker/deployer-extended special task. Read more on https://github.com/sourcebroker/deployer-extended#cache-clear-php-http 32 | after('deploy:symlink', 'cache:clear_php_http'); 33 | --------------------------------------------------------------------------------