3

I have been approached to develop some front-end components (CSS/JS & templates) for an existing Typo3 website. The client already has a development server set up, with Typo3 & extensions installed, and a copy of their database. I have SSH & FTP access to this development server. I am looking for advice on the fastest & most practical way to begin work on the templates.

My level of experience is that I have done front-end work with Typo3 before, but always in a team with an existing version control, build & deployment workflow. In this case, I would be responsible for setting up my own workflow and tools.

I have spent some time reading through version control, build & deployment-related questions on Stack Overflow, but many of them assume:

  1. A team with multiple developers
  2. A long-running project with major changes to functionality, in which it makes sense to invest considerable time up-front to the build process
  3. It is 2010.
  4. An existing workflow (e.g existing development environments) into which an additional tool such as git will be added.

In my case, I will be the only developer working on this, and I have been hired only to make some layout updates. I have no existing development environment for Typo3, and would need to set this up. My work on this project is not intended to run for more than a couple of weeks. I would like to find a solution somewhere in between "edit files directly on the development server" (very bad practise) and "set up a fully-featured PHP application deployment service using Magellanes" (probably good practise, but a steep learning curve for me and a large investment of time).

Ideally, I want to wind up in a situation where I have:

  • A local development environment on my Mac with Typo3 installed where I can preview & test code changes
  • Version control such as git on my local system
  • A way to push my changes to the development site

Can anyone share with me tools or workflow suggestions for how to get to that point as quickly as possible?

Community
  • 1
  • 1
Ila
  • 3,528
  • 8
  • 48
  • 76

1 Answers1

2

My environment is similar to yours, and this is my typical setup:

Version control

The website is version controlled with git. There may or may not be a repository to regularly push to, but my local version is always included in the backups. The following things are excluded from version control:

  • Files in typo3temp, but not the directories (Put the .gitignore at the end of the post into a directory to keep it, but not the files in it)
  • The server specific configuration
  • deprecation logs
  • IDE files
  • ...

To include the TYPO3 core, there are three variants:

  • Just add it to the repository
  • Add the core git repository as git submodule
  • Add symlinks to the core into the repository.

The latter may be problematic if the directory structure is different in both environments, and the first one clutters the repository, so when possible, go with the second one.

TYPO3 configuration

The TYPO3 configuration is split into three files:

  • Localconfiguration.php - version controlled, not manually edited (it is constantly overwritten by TYPO3).
  • AdditionalConfiguration.php - version controlled, manually edited.
  • ServerspecificConfiguration.php - not version controlled, manually edited. Contains database credentials, colorspaces for imagemagick when different on localhost and remote host, defines caching backends to use and similar stuff.

The additional configuration file includes the server specific file. Both use the \TYPO3\CMS\Core\Configuration\ConfigurationManagerConfigurationManager::setLocalConfigurationValueByPath('DB/host', 'localhost');-syntax for settings to make this work.

Deployment

To deploy the site, I have used two things:

  • git ftp - this is useful if there is only FTP access.
  • rsync - This is the better option.

To automate the deployment (and other stuff like building CSS from LESS or SASS), a task runner like grunt.js or ant is useful. Make sure you exclude the server specific configuration and typo3temp from synchronization.

Building such a setup from scratch does not take that much time, maybe 1 or 2 hours, but less then a day. This may of course differ depending on your experience.

Here is the .gitignore mentioned above:

*
!.gitignore
!*/
Jost
  • 5,948
  • 8
  • 42
  • 72
  • 1
    I just wanted to add that you should script rsync. Plus: use dry-run first. – Cedric Ziel Mar 16 '14 at 08:56
  • Your answer is now more than 3 years old. Has something changed? Are you using composer now? How do you handle the database in that setup? – Erik May 31 '17 at 08:57