Unverified Commit b0a9f3e7 authored by Sebastian Castro's avatar Sebastian Castro
Browse files

Include deploy script inside makefile

parent 16f9f21d
......@@ -5,6 +5,7 @@ EXEC_PHP = php
SYMFONY = $(EXEC_PHP) bin/console
COMPOSER = composer
NPM = npm
GIT = git
GULP = gulp
DOCKER = docker-compose
.DEFAULT_GOAL = help
......@@ -19,7 +20,7 @@ help: ## Outputs this help screen
composer-install: composer.lock ## Install Composer vendors according to the current composer.lock file
$(COMPOSER) install
update: composer.json ## Update vendors according to the composer.json file
composer-update: composer.json ## Update vendors according to the composer.json file
$(COMPOSER) update
## —— Symfony —————————————
......@@ -92,6 +93,19 @@ cs-fix: ## Run php-cs-fixer and fix the code
./vendor/bin/php-cs-fixer fix src/
## —— Deploy & Prod ———————
deploy: ## Deploy the project
$(SHELL) ./update_gogocarto.sh
gogo-update: ## Update a PROD server to the lastest version of gogocarto
$(GIT) reset --hard master
$(GIT) pull origin master
$(NPM) install
$(COMPOSER) install
$(GULP) build
$(GULP) production
$(SYMFONY) cache:clear --env=prod
sleep 10 && chmod 777 -R var/ &
sleep 60 && chmod 777 -R var/ &
sleep 120 && chmod 777 -R var/ &
sleep 300 && chmod 777 -R var/ &
sleep 600 && chmod 777 -R var/ &
sleep 2000 && chmod 777 -R var/ &
......@@ -10,7 +10,7 @@ Quick Install
- **Docker containers**: please follow the instructions [here](installation_docker.md).
Requirements
Manual Install: Requirements
------------
1. PHP 7
......@@ -25,12 +25,10 @@ Consider the [Docker installation](installation_docker.md) if you run into troub
Installation
------------
### Cloning Repository (clone dev branch)
### Cloning Repository
```shell
cd path-to-php-server-folder (default linux /var/www/html, windows c:/wamp/www... )
git clone https://gitlab.adullact.net/pixelhumain/GoGoCarto.git
cd GoGoCarto/
```
### Initialize the Project
......@@ -65,42 +63,17 @@ Start watching for file changes (automatic recompilation):
gulp watch
```
Updating your Install
Updating your Production Install
---------------------
Each time you want to update GoGoCarto, run:
```shell
make deploy
make gogo-update
```
You can have a look to [the CHANGELOG](../CHANGELOG.md) to know what are the new features.
Production
----------
Dump assets in Symfony console to update the web/templates files:
```
assets:install web
```
Generate compressed JS and CSS files:
```
gulp build
gulp production
```
Enable gz compression in your web server.
In the distant console (http://yoursite.com/web/_console):
```
cache:clear --env=prod
```
Make sure that the var folder is writable `chmod -R 771 var/`.
Issues
------
......
#!/bash/bin
git reset --hard master
git pull origin master
npm install
composer install
gulp build
gulp production
php bin/console cache:clear --env=prod
sleep 10 && chmod 777 -R var/ &
sleep 60 && chmod 777 -R var/ &
sleep 120 && chmod 777 -R var/ &
sleep 300 && chmod 777 -R var/ &
sleep 600 && chmod 777 -R var/ &
sleep 2000 && chmod 777 -R var/ &
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment