deploy_production:
    stage: deploy
    script:
        - 'sudo rsync -a --delete --inplace "$PWD/" /home/cbi/www/ --exclude=.git --exclude=.env --exclude=vendor/ --chown=cbi:users'
        - "cd /home/cbi/www"
        - "sudo php -d memory_limit=-1 composer.phar update -o"
        - "sudo php artisan ca:cl"
        - "sudo chown -R cbi:users ./*"
        - "sudo setfacl -R -m u:www-data:rwX -m u:cbi:rwX storage bootstrap/cache"
        - "sudo setfacl -dR -m u:www-data:rwX -m u:cbi:rwX storage bootstrap/cache"
    only:
        - pushes
        - master
        - schedules
    tags:
         - vitaweb-runner
    environment:
        name: production
