From 73d2fbc50a341f9a49baab8c896864bd2af2093e Mon Sep 17 00:00:00 2001 From: Marwolf Date: Fri, 6 Jul 2018 19:57:50 -0400 Subject: [PATCH] Additional changes --- Makefile | 15 ++++++++++++- README.md | 63 ++++++++++++++++++++++++++++--------------------------- 2 files changed, 46 insertions(+), 32 deletions(-) diff --git a/Makefile b/Makefile index ae47f8c..85ec42b 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ help: @echo "usage: make COMMAND" @echo "" @echo "Commands:" + @echo " first Perform first time setup and start containers" @echo " clone Clone the git repository folders" @echo " pull Get the latest git repository updates" @echo " start Create and start containers" @@ -22,6 +23,18 @@ help: @echo " flush Delete local git repository folders" @echo "" +first: init + docker-compose up -d + @$(shell cd Website && git clone https://github.com/Marwolf/Open-RSC-Website.git) + @$(shell mkdir Game && cd Game && git clone https://github.com/Marwolf/Open-RSC-Game.git) + @$(shell sudo chmod -R 777 Website/Open-RSC-Website && sudo chmod -R 777 Game/Open-RSC-Game && sudo chmod 644 Website/Open-RSC-Website/board/config.php) + @$(shell cd Website/Open-RSC-Website && git pull) + @$(shell cd Game/Open-RSC-Game && git pull) + @docker exec -i $(shell docker-compose ps -q mysqldb) mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Game/Open-RSC-Game/Databases/openrsc_config.sql 2>/dev/null + @docker exec -i $(shell docker-compose ps -q mysqldb) mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Game/Open-RSC-Game/Databases/openrsc_logs.sql 2>/dev/null + @docker exec -i $(shell docker-compose ps -q mysqldb) mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Game/Open-RSC-Game/Databases/openrsc.sql 2>/dev/null + @docker exec -i $(shell docker-compose ps -q mysqldb) mysql -u"$(MYSQL_ROOT_USER)" -p"$(MYSQL_ROOT_PASSWORD)" < Website/Open-RSC-Website/openrsc_forum.sql 2>/dev/null + start: init docker-compose up -d @@ -34,7 +47,7 @@ restart: init clone: @$(shell cd Website && git clone https://github.com/Marwolf/Open-RSC-Website.git) - @$(shell cd Game && git clone https://github.com/Marwolf/Open-RSC-Game.git) + @$(shell mkdir Game && cd Game && git clone https://github.com/Marwolf/Open-RSC-Game.git) @$(shell sudo chmod -R 777 Website/Open-RSC-Website && sudo chmod -R 777 Game/Open-RSC-Game && sudo chmod 644 Website/Open-RSC-Website/board/config.php) pull: diff --git a/README.md b/README.md index 1305323..a8a3869 100644 --- a/README.md +++ b/README.md @@ -59,10 +59,10 @@ ___ ## Run the application -1. Start the Docker application: +1. Perform first time setup and start the Docker application: ```sh - sudo make start + sudo make first ``` **Please wait this might take a several minutes...** @@ -71,63 +71,64 @@ ___ sudo make logs # Follow log output ``` -2. Clone the required git repositories: - - ```sh - sudo make clone - ``` - -3. Import the required databases: - - ```sh - sudo make import - ``` - -4. Open your favorite browser: +2. Open your favorite browser: * [http://localhost](http://localhost/) * [http://localhost:8080](http://localhost:8080/) PHPMyAdmin (username: root, password: root) -5. Backup your databases: +3. Backup your databases: ```sh sudo make backup ``` -6. Restore your databases: +4. Restore your databases: ```sh sudo make restore ``` -7. Get help: +5. Get help: ```sh sudo make help ``` -8. Stop the application: +6. Stop the application: ```sh sudo make stop ``` +7. Start the application: + + ```sh + sudo make start + ``` + +8. Restart the application: + + ```sh + sudo make restart + ``` + ___ ## Additional commands -| Name | Description | -|---------------|----------------------------------------------| -| clone | Clone the git repository folders | -| pull | Get the latest git repository updates | -| start | Create and start containers | -| stop | Stop all containers | -| restart | Restart all containers | -| logs | Display log output | -| import | Import all databases from git repositories | -| backup | Create backup of all local databases | -| restore | Restore backup of all local databases | -| flush | Delete local git repository folders | +| Name | Description | +|---------------|-----------------------------------------------| +| first | Perform first time setup and start containers | +| clone | Clone the git repository folders | +| pull | Get the latest git repository updates | +| start | Create and start containers | +| stop | Stop all containers | +| restart | Restart all containers | +| logs | Display log output | +| import | Import all databases from git repositories | +| backup | Create backup of all local databases | +| restore | Restore backup of all local databases | +| flush | Delete local git repository folders | ___