From c55cae0e6ece9e679ccafd0e5b9c7b6d87bee7ec Mon Sep 17 00:00:00 2001 From: FoxyHawk Date: Fri, 1 Feb 2019 15:06:06 +0100 Subject: [PATCH 1/3] update README.md with install instructions for Linux --- README.md | 104 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 85 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 405c644e..8b003748 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -insalan.fr -========== +# insalan.fr [![Build Status](https://travis-ci.org/InsaLan/insalan.fr.svg?branch=master)](https://travis-ci.org/InsaLan/insalan.fr) [![Maintainability](https://api.codeclimate.com/v1/badges/68707ca6cd1a2b332dc4/maintainability)](https://codeclimate.com/github/InsaLan/insalan.fr/maintainability) @@ -7,28 +6,87 @@ insalan.fr Website to handle esport tournament -Installation ------------- -Download vendors -Considering you have composer.phar installed and in your PATH : +## Installation + +The project need the following package and php-extension : + +Package | Comment +------- | ------- +git | +php | php7.0 +composer | +mariadb-server | if use with local database +zip | not necessary (only for unzip during install) + +PHP extension | Comment +------------- | ------- +php-curl | +php-intl | date translation +php-mbstring | doctrine:create:schema:create +php-mysql | +php-xml | + + +### Linux + + +#### Base packages + +Update your local packages + +```bash +sudo apt-get update && apt-get upgrade +``` + +Install git and clone the repository ```bash +sudo apt-get install git +git clone https://github.com/InsaLan/insalan.fr +``` + +It is recommended to get composer.phar in your PATH : https://getcomposer.org/doc/00-intro.md + +Install the other packages + +```bash +sudo apt-get install php php-curl php-intl php-mbstring php-mysql php-xml mariadb-server zip +``` + +Proceed with the install and accept default settings + +```bash +cd insalan.fr composer.phar install ``` -If not set with composer.phar, configure symfony2 : +At this point, you should be able to run the web server but any pages you try to access will return an error since the database is not setup. + + +#### mariadb + +Log in mariadb as root ```bash -cp app/config/parameters.yml.dist app/config/parameters.yml -vim app/config/parameters.yml +sudo mysql -u root -p +``` + +Create database, user and grant access + +```mariadb +CREATE DATABASE insalan; +CREATE USER insalan@'localhost'; +GRANT ALL PRIVILEGES ON insalan.* to insalan@'localhost'; ``` -Create database & load fixtures (php-mbstring needed) + +#### Fill database and run + +Load fixtures (php-mbstring needed) ```bash -php app/console doctrine:database:create -php app/console doctrine:schema:create +php app/console doctrine:schema:create #have to be killed php app/console doctrine:fixtures:load ``` @@ -50,17 +108,23 @@ Launch development server ```bash php app/console server:run #localhost only -php app/console server:run 0.0.0.0:9001 #available for everyone +php app/console server:run 0.0.0.0 #available for everyone ``` (you can also use the php builtin development web server : `cd web && php -S localhost:9001`) -Deploy on shared web hosting services -------------------------------------- + +### Windows + +TODO +http://www.wampserver.com/ should be able to provide everything you need. + + +## Deploy on shared web hosting services You can use the deploy-ftp script to deploy on a mutualised website. You must also have ncftp on your client (yum install ncftp/apt-get install ncftp) -1) Configure your deployment +1. Configure your deployment ```bash cd deploy/conf @@ -78,7 +142,7 @@ cp parameters.yml.dist parameters.yml vim parameters.yml ``` -2) Deploy +1. Deploy Deploy takes approximately 5 minutes. @@ -87,11 +151,13 @@ cd deploy ./deploy-ftp.sh ``` -3) Remove app/cache/prod content +1. Remove app/cache/prod content + Use filezilla to clear cache, ie remove app/cache/prod folder content Backup DB before deploy, update it locally and send it after deploy if you changed the schema. -4) Contributing file + +## Contributing If you wish to contribute to the insalan.fr project, refer to [this](https://github.com/insalan/insalan.fr/blob/master/CONTRIBUTING.md) file. From e3a18fec6690a1aacf2b9a75ea3a2a5c0222f9d0 Mon Sep 17 00:00:00 2001 From: FoxyHawk Date: Fri, 1 Feb 2019 15:15:15 +0100 Subject: [PATCH 2/3] rectify little mistakes --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 8b003748..e38cddf3 100644 --- a/README.md +++ b/README.md @@ -46,9 +46,9 @@ sudo apt-get install git git clone https://github.com/InsaLan/insalan.fr ``` -It is recommended to get composer.phar in your PATH : https://getcomposer.org/doc/00-intro.md +It is recommended to get `composer.phar` in your PATH : https://getcomposer.org/doc/00-intro.md -Install the other packages +Install the remaining packages ```bash sudo apt-get install php php-curl php-intl php-mbstring php-mysql php-xml mariadb-server zip @@ -86,7 +86,7 @@ GRANT ALL PRIVILEGES ON insalan.* to insalan@'localhost'; Load fixtures (php-mbstring needed) ```bash -php app/console doctrine:schema:create #have to be killed +php app/console doctrine:schema:create #have to be killed manually php app/console doctrine:fixtures:load ``` @@ -108,9 +108,9 @@ Launch development server ```bash php app/console server:run #localhost only -php app/console server:run 0.0.0.0 #available for everyone +php app/console server:run 0.0.0.0 #available for everyone on port 8000 ``` -(you can also use the php builtin development web server : `cd web && php -S localhost:9001`) +(you can also use the php builtin development web server : `cd web && php -S localhost:8000`) ### Windows @@ -124,7 +124,7 @@ http://www.wampserver.com/ should be able to provide everything you need. You can use the deploy-ftp script to deploy on a mutualised website. You must also have ncftp on your client (yum install ncftp/apt-get install ncftp) -1. Configure your deployment +### 1) Configure your deployment ```bash cd deploy/conf @@ -142,7 +142,7 @@ cp parameters.yml.dist parameters.yml vim parameters.yml ``` -1. Deploy +### 2) Deploy Deploy takes approximately 5 minutes. @@ -151,7 +151,7 @@ cd deploy ./deploy-ftp.sh ``` -1. Remove app/cache/prod content +### 3) Remove app/cache/prod content Use filezilla to clear cache, ie remove app/cache/prod folder content From 481b56279bfd423c5aad5f07f0ee0a1bfb2dac61 Mon Sep 17 00:00:00 2001 From: Antoine Bourven Date: Wed, 10 Apr 2019 08:27:34 +0200 Subject: [PATCH 3/3] Remove deploy part in README and ./deploy folder following superboum's advices --- README.md | 39 -------------------------- deploy/conf/.htaccess.dist | 1 - deploy/conf/ftp.cfg.dist | 5 ---- deploy/conf/parameters.yml.dist | 1 - deploy/deploy-ftp.sh | 49 --------------------------------- 5 files changed, 95 deletions(-) delete mode 120000 deploy/conf/.htaccess.dist delete mode 100644 deploy/conf/ftp.cfg.dist delete mode 120000 deploy/conf/parameters.yml.dist delete mode 100755 deploy/deploy-ftp.sh diff --git a/README.md b/README.md index e38cddf3..ad5b99ba 100644 --- a/README.md +++ b/README.md @@ -119,45 +119,6 @@ TODO http://www.wampserver.com/ should be able to provide everything you need. -## Deploy on shared web hosting services - -You can use the deploy-ftp script to deploy on a mutualised website. -You must also have ncftp on your client (yum install ncftp/apt-get install ncftp) - -### 1) Configure your deployment - -```bash -cd deploy/conf - -#Configure ftp -cp ftp.cfg.dist ftp.cfg -vim ftp.cfg - -#Configure .htaccess -cp .htaccess.dist .htaccess -vim .htaccess - -#Configure parameters.yml -cp parameters.yml.dist parameters.yml -vim parameters.yml -``` - -### 2) Deploy - -Deploy takes approximately 5 minutes. - -```bash -cd deploy -./deploy-ftp.sh -``` - -### 3) Remove app/cache/prod content - -Use filezilla to clear cache, ie remove app/cache/prod folder content - -Backup DB before deploy, update it locally and send it after deploy if you changed the schema. - - ## Contributing If you wish to contribute to the insalan.fr project, refer to [this](https://github.com/insalan/insalan.fr/blob/master/CONTRIBUTING.md) file. diff --git a/deploy/conf/.htaccess.dist b/deploy/conf/.htaccess.dist deleted file mode 120000 index 0bc65abf..00000000 --- a/deploy/conf/.htaccess.dist +++ /dev/null @@ -1 +0,0 @@ -../../web/.htaccess \ No newline at end of file diff --git a/deploy/conf/ftp.cfg.dist b/deploy/conf/ftp.cfg.dist deleted file mode 100644 index 098a5e72..00000000 --- a/deploy/conf/ftp.cfg.dist +++ /dev/null @@ -1,5 +0,0 @@ -server_host="127.0.0.1" -server_user="user" -server_password="p4ssw0rd" -server_path="/" -server_port="21" diff --git a/deploy/conf/parameters.yml.dist b/deploy/conf/parameters.yml.dist deleted file mode 120000 index 48ed029e..00000000 --- a/deploy/conf/parameters.yml.dist +++ /dev/null @@ -1 +0,0 @@ -../../app/config/parameters.yml.dist \ No newline at end of file diff --git a/deploy/deploy-ftp.sh b/deploy/deploy-ftp.sh deleted file mode 100755 index a86a7678..00000000 --- a/deploy/deploy-ftp.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/bash -color_bg='\033[45m' # Purple -color_reset='\033[0m' # Text Reset - -mkdir tmp -echo -e "\n$color_bg\n\tReading configuration file ftp.cfg\n$color_reset" -source conf/ftp.cfg - -echo -e "\n$color_bg\n\tCleaning dev environment\n$color_reset" -rm -r ../app/cache/dev/* -rm -r ../app/cache/prod/* -rm -r ../web/bundles/* - -echo -e "\n$color_bg\n\tGeneration prod cache\n$color_reset" -php ../app/console cache:clear --env=prod - -echo -e "\n$color_bg\n\tInstalling assets\n$color_reset" -php ../app/console assets:install ../web - -echo -e "\n$color_bg\n\tGenerating assetic prod\n$color_reset" -php ../app/console assetic:dump --env=prod - -echo -e "\n$color_bg\n\tCopying files\n$color_reset" -cp -r ../src ./tmp -cp -r ../web ./tmp -cp -r ../app ./tmp - -echo -e "\n$color_bg\n\tAdding specific connfiguration\n$color_reset" -cp ./conf/parameters.yml ./tmp/app/config -cp ./conf/.htaccess ./tmp/web - -echo -e "\n$color_bg\n\tRemoving dev files\n$color_reset" -rm ./tmp/web/app_dev.php -rm ./tmp/web/config.php -rm ./tmp/app/logs/* -rm -r ./tmp/app/cache/* - -echo -e "\n$color_bg\n\tSending src to $server_host$server_path/src as $server_user\n$color_reset" -ncftpput -R -v -u "$server_user" -p "$server_password" -P $server_port $server_host $server_path/src ./tmp/src/* - -echo -e "\n$color_bg\n\tSending web to $server_host$server_path/web as $server_user\n$color_reset" -ncftpput -R -v -u "$server_user" -p "$server_password" -P $server_port $server_host $server_path/web ./tmp/web/* - -echo -e "\n$color_bg\n\tSending app to $server_host$server_path/app as $server_user\n$color_reset" -ncftpput -R -v -u "$server_user" -p "$server_password" -P $server_port $server_host $server_path/app ./tmp/app/* - -#echo "rm -r $server_path/app/cache/prod/*" - -rm -r tmp