]>
Raphaƫl G. Git Repositories - airlibre/blob - run
4 export APP_SECRET
=`cat /dev/urandom | tr -dc 'A-Za-z0-9+,.:;@_-' | head -c 64`
5 export DATABASE_URL
='mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7'
6 export MAILER_DSN
='sendmail+smtp://default'
10 # Ask for a full reset
11 read -p 'Full reset Yes/[No] ?' full
14 if [ "$full" = 'Yes' -o "$full" = 'YES' -o "$full" = 'yes' ]; then
15 # Check if we have a rapsys racine
16 if [ -d vendor
/rapsys
]; then
17 # Process each remaining git sub directory
18 for i
in `ls -d vendor/rapsys/*`; do
20 # Stash modifications if present
24 # Force kick untracked files and directories
30 # Stash modifications if present
34 # Force kick untracked files and directories
38 sudo
rm -fr var
/{cache
/{dev
,prod
,test},log
,sessions
} public
/{css
,js
,img
,bundles
};
41 mkdir -p var
/{cache
/{dev
,prod
,test},log
,sessions
} public
/{css
,js
,img
,bundles
};
44 touch '.env.local.php'
47 chown
$USER.
'.env.local.php' var
/{cache
/{,dev
,prod
,test},log
,sessions
} public
/{,css
,js
,img
,bundles
};
50 setfacl
-m u
:apache
:rwX
'.env.local.php' var
/{cache
/{,dev
,prod
,test},log
,sessions
} public
/{css
,js
,img
,bundles
};
53 composer
install --no-scripts
59 git checkout
-- composer.json
61 # Recreate src/Entity for doctrine
64 # Run scripts as apache
65 sudo
-u apache composer auto
-scripts
68 perl
-ne 'my %e=(APP_ENV=>"'$APP_ENV'",APP_SECRET=>"'${APP_SECRET/@/\\@}'",DATABASE_URL=>"'${DATABASE_URL/@/\\@}'",MAILER_DSN=>"'$MAILER_DSN'");my $p=join("|",keys %e);if(/^[#\s]*($p)=/){$_=$1."=\"".$e{$1}."\"\n";};print $_;' -i.orig .env
71 sudo
-u apache composer symfony
:dump
-env $APP_ENV
74 setfacl
-b '.env.local.php'
77 sudo
-u apache php bin
/console doctrine
:schema
:drop
--force
79 # Create current schema
80 sudo
-u apache php bin
/console doctrine
:schema
:create
83 sudo
-u apache php bin
/console doctrine
:fixtures
:load
--env=dev
--no-interaction
86 sudo
-u apache php bin
/console cache
:clear
89 rm -fr var
/{cache
/{dev
,prod
,test},log
,sessions
} public
/bundles
;
92 mkdir -p var
/{cache
/{dev
,prod
,test},log
,sessions
} public
/{,bundles
/rapsyspack
/}{css
,js
,img
};
95 sudo chown
$USER. var
/{cache
/{,dev
,prod
,test},log
,sessions
} public
/{,css
,js
,img
,bundles
/{,rapsyspack
/{,css
,js
,img
}}};
98 sudo setfacl
-m u
:apache
:rwX var
/{cache
/{,dev
,prod
,test},log
,sessions
} public
/{css
,js
,img
,bundles
/{,rapsyspack
/{css
,js
,img
}}};
100 # Run composer update
101 composer update
--no-scripts
106 # Reset composer.json
107 git checkout
-- composer.json
110 rm -fr var
/{cache
/{dev
,prod
,test},log
,sessions
} public
/bundles
;
113 mkdir -p var
/{cache
/{dev
,prod
,test},log
,sessions
} public
/{,bundles
/rapsyspack
/}{css
,js
,img
};
116 sudo chown
$USER. var
/{cache
/{,dev
,prod
,test},log
,sessions
} public
/{,css
,js
,img
,bundles
/{,rapsyspack
/{,css
,js
,img
}}};
119 sudo setfacl
-m u
:apache
:rwX var
/{cache
/{,dev
,prod
,test},log
,sessions
} public
/{css
,js
,img
,bundles
/{,rapsyspack
/{,css
,js
,img
}}};
121 # Run scripts as apache
122 sudo
-u apache composer auto
-scripts
125 sudo
-u apache php bin
/console cache
:clear
129 mkdir -p var
/{cache
/{dev
,prod
,test},log
,sessions
} public
/{,bundles
/rapsyspack
/}{css
,js
,img
};
132 sudo chown
$USER. var
/{cache
/{,dev
,prod
,test},log
,sessions
} public
/{,css
,js
,img
,bundles
/{,rapsyspack
/{,css
,js
,img
}}};
135 setfacl
-m u
:apache
:rwX var
/{cache
/{,dev
,prod
,test},log
,sessions
} public
/{css
,js
,img
,bundles
/{,rapsyspack
/{css
,js
,img
}}};