I’ve created post-receive hook for git repository which checkouts commit to web folder /var/www/myproject. Since I’m not committing dependencies (framework files), when checked out I have to install dependencies and init the framework. I see two approaches:
When checked out run the following commands from the project directory:
php init --env=Development --overwrite=n
#other commands to setup db connection, credentials etc.
Install dependencies one level up of checked out project /var/www and have links one level up. But it seems that with this approach I’ll still need to run php init.
I like this as i) there is no risk of over-writing configs on the live server, I can just upload the entire protected directory ii) my testing server will often include main-live but common/main-dev and params-dev
Whether this is the “right” way or not is debatable - it’s more about your server setup and your preference.