ad 1) Ich würde es on-deploy machen. Hier eine Beispiel .mage.yml aus unseren Projekten:
Code:
magephp:
environments:
live:
user: foo
hosts:
- foo.example.org
host_path: /var/www/foo
releases: 2
# exclude everything that is installed via composer or not needed otherwise
exclude:
- ./app/config/parameters.yml
- ./assets
- ./files/content
- ./node_modules
- ./system
- ./var
- ./vendor
- ./.gitignore
- ./.mage.yml
- ./.php_cs.dist
- ./.travis.yml
- ./README.md
pre-deploy:
# check security
- exec: { cmd: 'php vendor/bin/security-checker security:check', desc: 'Security check' }
on-deploy:
# symlink the parameters.yml
- fs/link: { from: '../../../../shared/app/config/parameters.yml', to: 'app/config/parameters.yml' }
# symlink the files/content directory
- fs/link: { from: '../../../shared/files/content', to: 'files/' }
# execute composer install, with an increased timeout (could take a while)
- composer/install: { timeout: 300 }
on-release:
post-release:
post-deploy:
# use custom PHP CLI path and composer.phar
composer:
path: /etc/bin/php72 ~/composer.phar
ad 2) Der user, der da eingetragen ist, ist ja der entsprechende user am Server der jeweiligen Umgebung. Der sollte ja für alle gleich sein.