cleaned ups somethings

This commit is contained in:
Nick Yeoman 2023-04-11 11:22:23 -07:00
parent 00fd8542c3
commit 5e72e23051
4 changed files with 27 additions and 35 deletions

View File

@ -2,7 +2,7 @@
## Requirements
* ubuntu php-cli (sudo nala install php-curl php-xml php-mysql)
* ubuntu php-cli (sudo nala install curl unzip php-curl php-xml php-mysql)
* [Install Composer](https://www.nickyeoman.com/page/install-composer-on-ubuntu)
* [Symfony cli](https://symfony.com/download)
@ -23,9 +23,9 @@ The next steps to take would be:
1. Verify the ```.env``` and ```docker-compose.md``` file
1. start docker ```sudo docker-compose up -d```
1. [Create your controllers](https://git.gopo.li/nick/symfony/src/branch/main/docs/Controller.md)
1. [Create your controllers](https://git.nickyeoman.com/nick/symfony/src/branch/main/docs/Controller.md)
1. Run sass ```sass sass/project.sass public/css/main.css```
1. [Create your security](https://git.gopo.li/nick/symfony/src/branch/main/docs/Security.md)
1. [Create your security](https://git.nickyeoman.com/nick/symfony/src/branch/main/docs/Security.md)
# Currently supported and tested on

View File

@ -1,12 +1,18 @@
#!/bin/bash
################################################################################
# Nix install symfony bash script
# v1.0.0
# v2
################################################################################
echo "*** Starting New Symfony Project ***"
################################################################################
# Check parameter (folder name)
################################################################################
# check that $1 folder does not exit
if [ -z "$1" ]
then
echo "Please provide a folder name"
exit 1
fi
[ -d "$1" ] && echo "Folder $1 already exists" && exit 1
################################################################################
@ -64,7 +70,6 @@ echo "Your twig.yaml config file has been replaced, remove the bak if you are ha
################################################################################
echo "Creating SASS directory for css"
composer require nickyeoman/nytwig
composer require nickyeoman/sassLibrary
touch sass/$1.sass
mkdir -p public/css
@ -104,7 +109,8 @@ composer require symfonycasts/verify-email-bundle
# Database
################################################################################
composer req -n orm && sleep 1
composer req -n orm --with-all-dependencies
sleep 2
# TODO: In the future you may want to replace this with code
# ( but not here if you are sharing the script)
@ -118,6 +124,7 @@ composer req -n orm && sleep 1
composer req symfony/apache-pack
#TODO: find a way to trigger this without interaction
# You need the following variables in your env for docker-compose
# You need the following variables in your env for docker-compose
echo '' >> .env
echo '# For Docker compose' >> .env
@ -126,20 +133,21 @@ echo 'DOCKERIMAGE=YOUR_NAME/YOUR_IMAGE_NAME' >> .env
echo 'DOCKERVER=latest' >> .env
echo 'DOCKERNET=DOCKER_NETWORK_NAME_FOR_PROXY' >> .env
echo "DOCKERPORT=8000" >> .env
GEN=`echo $RANDOM | md5sum | head -c 12`
echo "MYSQL_ROOT_PASSWORD=${GEN}" >> .env
ROOTPASS=`echo $RANDOM | md5sum | head -c 12`
echo "MYSQL_ROOT_PASSWORD=${ROOTPASS}" >> .env
echo 'DOCKERPHPMYADMIN=8001' >> .env
echo '' >> .env
echo '# Database info, should match your db url' >> .env
echo 'DBHOST=mariadb' >> .env
echo 'DB=symfony_project' >> .env
GEN=`echo $RANDOM | md5sum | head -c 4`
echo "DBUSER=theuser${GEN}" >> .env
GEN=`echo $RANDOM | md5sum | head -c 12`
echo "DBPASSWORD=${GEN}" >> .env
DBHOST='mariadb'
echo "DBHOST=${DBHOST}" >> .env
DB='symfony_project'
echo "DB=${DB}" >> .env
DBUSER=`echo $RANDOM | md5sum | head -c 4`
echo "DBUSER=theuser${DBUSER}" >> .env
DBPASS=`echo $RANDOM | md5sum | head -c 12`
echo "DBPASSWORD=${DBPASS}" >> .env
echo '' >> .env
echo '# DATABASE_URL="mysql://app:!ChangeMe!@127.0.0.1:3306/app?serverVersion=mariadb-10.4.11&charset=utf8mb4"' >> .env
echo "DATABASE_URL=\"mysql://theuser${DBUSER}:${DBPASS}@${DBHOST}:3306/${DB}?serverVersion=mariadb-10.4.11&charset=utf8mb4\"" >> .env
# TODO: move these here after you have symfony production ready
rm docker-compose.yml
@ -154,10 +162,8 @@ wget https://raw.githubusercontent.com/nickyeoman/phpframework/main/docker/Docke
# Routes
################################################################################
mv config/routes/routes.yaml config/routes/routes.yaml.bak
wget https://git.nickyeoman.com/nick/symfony/raw/branch/main/routes/routes.yaml
mv routes.yaml config/routes/routes.yaml
mv routes.yaml config/routes/symfonycms.yaml
################################################################################
# Clean up

View File

@ -1,8 +0,0 @@
# EasyAdmin Bundle
I decided not to use this as it comes with a lot of stuff you don't want.
Symfony 6
Admin Bundle 4
https://www.youtube.com/playlist?list=PLrVW8QdFhIiA1da1zOhnhmAMqYoeyGKxV

View File

@ -1,8 +1,2 @@
controllers:
resource:
path: ../src/Controller/
namespace: App\Controller
type: attribute
NickYeomanSymfonyCMS:
resource: '@SymfonyCMSBundle/config/routes.yaml'