Skip to content

Instantly share code, notes, and snippets.

@alexbonhomme
Last active May 30, 2017 15:15
Show Gist options
  • Save alexbonhomme/02fc0f3b4e8ab38f1d4dca398f9a5ca0 to your computer and use it in GitHub Desktop.
Save alexbonhomme/02fc0f3b4e8ab38f1d4dca398f9a5ca0 to your computer and use it in GitHub Desktop.

Workflow de mise en production pour Symfony 3

Clone du dépot

git clone ...

Vérfier les deps Symfony

php bin/symfony_requirements

Installation deps

export SYMFONY_ENV=prod
composer install --no-dev --optimize-autoloader
php bin/console cache:clear --env=prod --no-debug

Vérifier/corriger les droits du dossier var

chown -R USER:www-data var

Initialiser la base Doctrine

php bin/console doctrine:schema:update --force

Créer l'utilisateur admin

php bin/console fos:user:create ADMIN_USER ADMIN_EMAIL STRONG_PASSWORD
php bin/console fos:user:promote ADMIN_USER ROLE_ADMIN

Créer le client OAuth2

php bin/console acme:oauth-server:client:create --grant-type="password" --grant-type="refresh_token" --grant-type="http://platform.local/grants/facebook_access_token" --grant-type="http://platform.local/grants/google_access_token"

Mise à jours (nouvelle version)

git pull
git checkout VERSION
export SYMFONY_ENV=prod
php bin/console doctrine:migrations:migrate
php bin/console cache:clear --env=prod

Sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment