Skip to content

Commit d086199

Browse files
[TASK] Deployment running Git pull and Composer (#5614)
* [TASK] Deployment running Git pull and Composer Releases: main, 13.4, 12.4 * [TASK] Deployment running Git pull and Composer Releases: main, 13.4, 12.4 * [TASK] Deployment running Git pull and Composer Releases: main, 13.4, 12.4 * [TASK] Language checks Releases: main * Update Index.rst --------- Co-authored-by: Sarah McCarthy <sarahmccarthy123@yahoo.com>
1 parent a4ef4cd commit d086199

File tree

2 files changed

+190
-6
lines changed

2 files changed

+190
-6
lines changed
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
:navigation-title: Git and Composer
2+
3+
.. include:: /Includes.rst.txt
4+
.. _deployment-git-composer:
5+
6+
======================================
7+
Deploying TYPO3 Using Git and Composer
8+
======================================
9+
10+
This guide describes how to deploy a TYPO3 project directly onto your server
11+
using **Git** and **Composer**, without the need for additional deployment tools.
12+
13+
This method is **simple to set up** and **requires no external deployment services**,
14+
but it does require **Git and Composer to be installed on the server** and may cause
15+
**downtime during updates**.
16+
17+
For a detailed comparison with other deployment methods, including **Deployer**
18+
and **rsync**, see section
19+
`Comparison of deployment methods <https://docs.typo3.org/permalink/t3coreapi:deployment-tools-comparision>`_.
20+
21+
.. _deployment-git-composer-quick:
22+
23+
Quick start: Deploy with Git and Composer
24+
=========================================
25+
26+
Execute the following in the folder into which your project was originally
27+
:ref:`cloned <deployment-git-composer-clone>`. The folder must
28+
contain the :path:`.git` directory.
29+
30+
.. code-block:: bash
31+
32+
cd /var/www/your-project
33+
git pull
34+
composer install --no-dev
35+
vendor/bin/typo3 database:updateschema
36+
vendor/bin/typo3 cache:flush
37+
38+
This performs a basic update of your project code and dependencies in production
39+
mode.
40+
41+
See also chapter `Finding or installing Composer on the server <https://docs.typo3.org/permalink/t3coreapi:direct-server-composer-access>`_.
42+
43+
.. _deployment-git-composer-detailed:
44+
45+
Detailed deployment instructions
46+
================================
47+
48+
The following sections explain the deployment process step by step.
49+
50+
Prerequisites:
51+
52+
- The TYPO3 project is under version control using Git. See chapter
53+
`Version control of TYPO3 projects with Git <https://docs.typo3.org/permalink/t3coreapi:version-control>`_
54+
- `TYPO3 was installed using Composer <https://docs.typo3.org/permalink/t3coreapi:installation-composer>`_
55+
- The server has **PHP**, **Composer**, **Git**, and other required system packages installed.
56+
- **Shell (SSH) access** to the server to run deployment commands.
57+
58+
.. _deployment-git-composer-clone:
59+
60+
Step 1: Clone or update the repository
61+
--------------------------------------
62+
63+
**First-time setup:**
64+
65+
.. code-block:: bash
66+
67+
git clone <your-git-repository-url> /var/www/your-project
68+
cd /var/www/your-project
69+
70+
**On subsequent deployments:**
71+
72+
.. code-block:: bash
73+
74+
cd /var/www/your-project
75+
git pull
76+
77+
.. _deployment-git-composer-install:
78+
79+
Step 2: Install production dependencies
80+
---------------------------------------
81+
82+
Install only production-relevant packages by running:
83+
84+
.. code-block:: bash
85+
86+
composer install --no-dev --ignore-platform-reqs
87+
88+
Parameter `--no-dev` excludes development packages. If the PHP version running
89+
on the console and the PHP version running on the server differ, you may need
90+
to use `--ignore-platform-reqs` to skip platform checks.
91+
92+
.. _deployment-git-composer-commands:
93+
94+
Step 3: Run TYPO3 maintenance commands
95+
--------------------------------------
96+
97+
Apply database schema updates if required:
98+
99+
.. code-block:: bash
100+
101+
vendor/bin/typo3 database:updateschema
102+
103+
Clear TYPO3 caches:
104+
105+
.. code-block:: bash
106+
107+
vendor/bin/typo3 cache:flush
108+
109+
Optional: Run project-specific tasks as needed.

Documentation/Administration/Deployment/Tools/Index.rst

Lines changed: 81 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,99 @@
77
Deployment tools
88
================
99

10-
The following tools can be used to deploy TYPO3 manually or automatically
11-
in a :abbr:`CI (Continuos Integration)` pipeline.
10+
The following tools can be used to deploy TYPO3 either manually or in an automated
11+
:abbr:`CI (Continuos Integration)` pipeline.
1212

1313
.. toctree::
1414
:titlesonly:
1515

1616
Rsync/Index
1717
Deployer/Index
18+
GitComposer/Index
1819
*/Index
1920

21+
.. _deployment-tools-comparision:
22+
23+
Comparison of deployment tools
24+
==============================
25+
26+
.. t3-field-list-table::
27+
:header-rows: 1
28+
29+
- :Method: Method
30+
:Pros: Pros
31+
:Cons: Cons
32+
:Typical Use Cases: Typical Use Cases
33+
34+
- :Method: Git + Composer
35+
:Pros:
36+
- Simple setup
37+
- No extra tooling needed
38+
- Version control on server
39+
:Cons:
40+
- Composer and Git must be installed on production server
41+
- Possible downtime during install
42+
- Risk of untracked local changes on server
43+
- Deployment may fail if external package sources are temporarily unavailable
44+
:Typical Use Cases:
45+
- Small to medium projects
46+
- Developers familiar with CLI
47+
- Environments without CI/CD tooling
48+
49+
- :Method: Deployer
50+
:Pros:
51+
- Atomic deployment with rollback
52+
- Zero-downtime deployments
53+
- Keeps release history
54+
:Cons:
55+
- Additional tool to learn and configure
56+
- Deployment process might be too complex for beginners
57+
:Typical Use Cases:
58+
- Professional production environments
59+
- Teams with CI/CD pipelines
60+
- Projects requiring rollback capabilities
61+
62+
- :Method: Manual rsync
63+
:Pros:
64+
- No requirement for Composer/Git
65+
- Simple file transfer
66+
:Cons:
67+
- Requires staging/build environment
68+
- Risk of partial updates if interrupted
69+
- No version tracking on the server
70+
:Typical Use Cases:
71+
- Static file transfer or legacy systems
72+
- Environments without PHP/Composer tooling on production
73+
74+
- :Method: No Deployment (Direct Installation on Server)
75+
:Pros:
76+
- No deployment tooling required
77+
- Easy to get started for single updates
78+
:Cons:
79+
- No version control or rollback possible
80+
- High risk of human error
81+
- No automation, no reproducibility
82+
:Typical Use Cases:
83+
- Very small or legacy projects
84+
- One-time manual updates
85+
- Not recommended for professional environments
86+
87+
.. rubric:: Summary:
88+
89+
- **Git + Composer**: Easy but requires server-side tooling.
90+
- **Deployer**: Advanced, safe, and rollback-friendly but requires extra setup.
91+
- **Manual rsync**: Simple file sync, but requires external build or packaging steps.
92+
- **No Deployment (Direct Installation on Server**): Easy to get started, but risky, untracked, and not recommended for professional environments.
93+
94+
Select the method that best suits your workflow and server capabilities.
95+
2096
.. _deployment-magallanes:
2197
.. _deployment-typo3-surf:
2298

2399
Other deployment tools
24100
======================
25101

26-
* :doc:`TYPO3 Surf <ext_surf:Index>` was used as a deployment tool
27-
specialized on TYPO3. It has mostly been succeeded by
28-
`Deployer <https://docs.typo3.org/permalink/t3coreapi:deployment-deployer>`_
29-
however.
102+
* :doc:`TYPO3 Surf <ext_surf:Index>` was formerly commonly used as a TYPO3 deployment tool.
103+
It has now mostly been succeeded by
104+
`Deployer <https://docs.typo3.org/permalink/t3coreapi:deployment-deployer>`_.
30105
* Another deployment tool for PHP applications written in PHP: https://www.magephp.com/

0 commit comments

Comments
 (0)