Hello all,
I wanted to ask what the best practices for Version control and for a good deployment workflow are. I'm currently developing a website, where I don't really need the CMS part.
Currently, I'm putting the following directories and files under version control:
- mysite directory
- themes directory with my custom theme only
- composer.json
- composer.lock
Should I put other files under version control? Please consider that I'm trying to put only those files under version control that cannot be retrieved via composer and that are specific to my website.
I then develop using the following flow:
1) Create a silverstripe project using composer.
2) Execute the installation
3) Develop on my dev machine.
4) Code will be pushed via git to a git repository (beanstalkapp.com in my case).
5) Code will be deployed to the test web server.
Step 5 is what confuses me. Ideally, my goal would be to completely remove the old deployed version and redeploy everything. So step 5 would be split up in:
1) Create backup of old working version
2) Create silverstripe project with composer. Not sure if this step is really needed, since I have composer.json and composer.lock version controlled and I could just run "composer install/update" later.
3) Execute the web installation. Since I don't use the CMS, is the web installation anyway required?
4) Copy over the files from Beanstalk
5) Copy over _ss_environment.php from old working directory to have the correct settings.
6) Execute "composer install" (or is a "composer update" enough?) to get all required dependencies.
7) Execute make and run some tests that confirm that everything is fine.
Please let me know what you think of the explained workflow. I would really appreciate some feedback.