Skip to content

Adopting a Methodology

Teaching is about repeating the same thing again and again. I won't do that. I promise. At the end of each step, you should do a little dance and save your work. It is like Ctrl+S but for a website.

Implementing a Git Strategy

At the end of each step, don't forget to commit your changes:

1
2
$ git add .
$ git commit -m'Add some new feature'

You can safely add "everything" as Symfony manages a .gitignore file for you. And each package can add more configuration. Have a look at the current content:

.gitignore
1
2
3
4
5
6
7
8
9
###> symfony/framework-bundle ###
/.env.local
/.env.local.php
/.env.*.local
/config/secrets/prod/prod.decrypt.private.php
/public/bundles/
/var/
/vendor/
###< symfony/framework-bundle ###

The funny strings are markers added by Symfony Flex so that it knows what to remove if you decide to uninstall a dependency. I told you, all the tedious work is done by Symfony, not you.

It could be nice to push your repository to a server somewhere. GitHub, GitLab, or Bitbucket are good choices.

Note

If you are deploying on Platform.sh, you already have a copy of the Git repository as Platform.sh uses Git behind the scenes when you are using cloud:deploy. But you should not rely on the Platform.sh Git repository. It is only for deployment usage. It is not a backup.

Deploying to Production Continuously

Another good habit is to deploy frequently. Deploying at the end of each step is a good pace:

1
$ symfony cloud:deploy
This work, including the code samples, is licensed under a Creative Commons BY-NC-SA 4.0 license.
TOC
    Version