Created
March 28, 2017 18:07
-
-
Save 68040/17b33f8e38ee80d967af7218b680a100 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## | |
## Usage: ./install_kyela.sh | |
## | |
## Draft | |
## Install Kyélà (1.6.2) on Uberspace by Noodle / Chris | |
## | |
## Sources: | |
## https://github.com/abienvenu/Kyela | |
## http://symfony.com/doc/current/setup.html | |
## https://getcomposer.org/doc/00-intro.md | |
############# | |
## Go Home ## | |
############# | |
cd ~ | |
############## | |
## Composer ## | |
############## | |
curl -LsS https://getcomposer.org/installer | php -- --install-dir=$HOME/bin --filename=composer | |
############# | |
## Symfony ## | |
############# | |
curl -LsS https://symfony.com/installer -o $HOME/bin/symfony && chmod a+x $HOME/bin/symfony | |
################# | |
## New project ## | |
################# | |
symfony new kyela 2.8 | |
cd kyela | |
# Config | |
sed -i -e "s#\"config\": {#\"config\": {\n\t\"component-dir\"\: \"web\/components\",#" composer.json | |
### TEST ### | |
# http://symfony.com/doc/current/setup/built_in_web_server.html | |
# php app/console server:start | |
# | |
# curl http://127.0.0.1:8000 | |
# | |
# php app/console server:stop | |
### TEST ENDE ### | |
############ | |
## Kyélà ## | |
############ | |
# Get bundle | |
composer require "abienvenu/kyela dev-master" | |
# Config | |
sed -i -e "s#new AppBundle\\\AppBundle(),#new Symfony\\\Bundle\\\AsseticBundle\\\AsseticBundle(),\n\ \ \ \ \ \ \ \ \ \ \ \ new Abienvenu\\\KyelaBundle\\\KyelaBundle(),\n\ \ \ \ \ \ \ \ \ \ \ \ new AppBundle\\\AppBundle(),#" app/AppKernel.php | |
cat <<__EOF__ >> app/config/routing.yml | |
kyela: | |
resource: "@KyelaBundle/Resources/config/routing.yml" | |
prefix: /kyela | |
__EOF__ | |
sed -i -e "s#imports:#imports:\n\ \ \ \ - { resource: "@KyelaBundle/Resources/config/config.yml" }#" app/config/config.yml | |
cat <<__EOF__ >> app/config/config.yml | |
## Kyela Bundles | |
assetic: | |
bundles: [ 'KyelaBundle' ] | |
filters: | |
cssrewrite: ~ | |
__EOF__ | |
app/console assetic:dump | |
###################### | |
## MySQL Parameters ## | |
###################### | |
eval $(grep -A 5 "\[client\]" ~/.my.cnf | grep "^port=") && eval $(grep -A 5 "\[client\]" ~/.my.cnf | grep "^user=") && eval $(grep -A 5 "\[client\]" ~/.my.cnf | grep "^password=") && sed -i -e "s#database_port: null#database_port: ${port}#" -e "s#database_name: symfony#database_name: ${user}_kyela#" -e "s#database_user: root#database_user: ${user}#" -e "s#database_password: null#database_password: ${password}#" app/config/parameters.yml | |
############## | |
## DB setup ## | |
############## | |
php app/console doctrine:database:create | |
php app/console doctrine:schema:create | |
#php app/console doctrine:schema:update --force | |
###################### | |
## Start App Server ## | |
###################### | |
# ToDo: Portfreigabe via add-port oder Weiterleitung via .htaccess | |
php app/console server:start 127.0.0.1:61234 | |
########## | |
## Done ## | |
########## |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment