Readme.md 2.96 KB
Newer Older
Thomas Löffler's avatar
Thomas Löffler committed
1 2 3 4 5 6 7
# Documentation

## Creating project

Before creating a project, we need to create an empty directory.

```bash
Thomas Löffler's avatar
Thomas Löffler committed
8
mkdir typo3-from-scratch
Thomas Löffler's avatar
Thomas Löffler committed
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
cd typo3-from-scratch
```

After that get the composer packages we want:

```bash
composer require typo3/minimal:^9 helhum/typo3-secure-web helhum/typo3-console
``` 

The package [helhum/typo3-secure-web](https://github.com/helhum/typo3-secure-web) divides the installation to two folders.<br>
The folder holding the TYPO3 installation you know is in the `root-dir`.<br>
The folder `web-dir` and therefore the document root consists only of the needed files for running TYPO3.

To divide it, we need to edit the `composer.json` file and add:

```json
"extra": {
    "typo3/cms": {
         "root-dir": "private",
         "web-dir": "public"

    }
}
```

After that, remove the previously generated public folder and run composer again:

```bash
rm -Rf public/
composer install
```

## Local environment (ddev)

Using ddev, you need to have [Docker](https://ddev.readthedocs.io/en/stable/users/docker_installation/) and [ddev](https://ddev.readthedocs.io/en/stable/#installation) installed before.

To configure ddev, just initialize it by:

```bash
ddev config
```

You can just push enter when asked for three questions.
Only thing to do is to move the generated file `AdditionalConfiguration.php` afterwards due to ddev is not compatible to typo3-secure-web.
ddev generates the file in docroot where it makes no sense, since TYPO3 looks for it in `root-dir`.

```bash
mv public/typo3conf/AdditionalConfiguration.php private/typo3conf/
``` 

After that you can setup TYPO3:

```bash
touch private/FIRST_INSTALL
ddev start
```

Visit the given URL http://typo3-from-scratch.ddev.site to go through the setup wizard and create your admin account.

## Project extensions

To setup project extensions in a separate folder, use e.g. `packages` and add your project extensions in there.<br>
Add this folder in composer.json so that composer knows where to look:

```json
"repositories": [
    {
        "type": "path",
        "url": "packages/*"
    }
],
```
Then you can add your project extension.<br>
Thomas Löffler's avatar
Thomas Löffler committed
82
You only need minimum two files in your extension folder:
Thomas Löffler's avatar
Thomas Löffler committed
83 84 85 86 87 88 89 90 91 92 93 94 95

* ext_emconf.php
* composer.json

The composer.json needs minimum title (e.g. `vendor/sitepackage`), type (`typo3-cms-extension`) and the requirement of `typo3/cms-core`.<br>

Then you can add it by:

```bash
composer require vendor/sitepackage:"@dev"
```

The extension will now be symlinked into typo3conf/ext/sitepackage.
Thomas Löffler's avatar
Thomas Löffler committed
96

97 98 99 100 101 102 103 104 105 106
## GitLab

To activate GitLab CI/CD you only need to add a `.gitlab-ci.yml` file into the root of your repository.

The YAML file defines the complete pipeline in form of stages and the correspoding jobs to do in these stages.
In this repository you can see an example of a short build.

More information you can get in [the official documentation](https://docs.gitlab.com/ce/ci/yaml/)

Examples:
Thomas Löffler's avatar
Thomas Löffler committed
107
* [typo3.org pipeline](https://git-t3o.typo3.org/t3o/t3olayout/blob/master/Configuration/GitLab/t3o-builds.yml)
108