Additional changes

This commit is contained in:
Marwolf
2018-07-06 19:57:50 -04:00
parent 2b32c2d124
commit 73d2fbc50a
2 changed files with 46 additions and 32 deletions

View File

@@ -10,6 +10,7 @@ help:
@echo "usage: make COMMAND" @echo "usage: make COMMAND"
@echo "" @echo ""
@echo "Commands:" @echo "Commands:"
@echo " first Perform first time setup and start containers"
@echo " clone Clone the git repository folders" @echo " clone Clone the git repository folders"
@echo " pull Get the latest git repository updates" @echo " pull Get the latest git repository updates"
@echo " start Create and start containers" @echo " start Create and start containers"
@@ -22,6 +23,18 @@ help:
@echo " flush Delete local git repository folders" @echo " flush Delete local git repository folders"
@echo "" @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 start: init
docker-compose up -d docker-compose up -d
@@ -34,7 +47,7 @@ restart: init
clone: clone:
@$(shell cd Website && git clone https://github.com/Marwolf/Open-RSC-Website.git) @$(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) @$(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: pull:

View File

@@ -59,10 +59,10 @@ ___
## Run the application ## Run the application
1. Start the Docker application: 1. Perform first time setup and start the Docker application:
```sh ```sh
sudo make start sudo make first
``` ```
**Please wait this might take a several minutes...** **Please wait this might take a several minutes...**
@@ -71,63 +71,64 @@ ___
sudo make logs # Follow log output sudo make logs # Follow log output
``` ```
2. Clone the required git repositories: 2. Open your favorite browser:
```sh
sudo make clone
```
3. Import the required databases:
```sh
sudo make import
```
4. Open your favorite browser:
* [http://localhost](http://localhost/) * [http://localhost](http://localhost/)
* [http://localhost:8080](http://localhost:8080/) PHPMyAdmin (username: root, password: root) * [http://localhost:8080](http://localhost:8080/) PHPMyAdmin (username: root, password: root)
5. Backup your databases: 3. Backup your databases:
```sh ```sh
sudo make backup sudo make backup
``` ```
6. Restore your databases: 4. Restore your databases:
```sh ```sh
sudo make restore sudo make restore
``` ```
7. Get help: 5. Get help:
```sh ```sh
sudo make help sudo make help
``` ```
8. Stop the application: 6. Stop the application:
```sh ```sh
sudo make stop sudo make stop
``` ```
7. Start the application:
```sh
sudo make start
```
8. Restart the application:
```sh
sudo make restart
```
___ ___
## Additional commands ## Additional commands
| Name | Description | | Name | Description |
|---------------|----------------------------------------------| |---------------|-----------------------------------------------|
| clone | Clone the git repository folders | | first | Perform first time setup and start containers |
| pull | Get the latest git repository updates | | clone | Clone the git repository folders |
| start | Create and start containers | | pull | Get the latest git repository updates |
| stop | Stop all containers | | start | Create and start containers |
| restart | Restart all containers | | stop | Stop all containers |
| logs | Display log output | | restart | Restart all containers |
| import | Import all databases from git repositories | | logs | Display log output |
| backup | Create backup of all local databases | | import | Import all databases from git repositories |
| restore | Restore backup of all local databases | | backup | Create backup of all local databases |
| flush | Delete local git repository folders | | restore | Restore backup of all local databases |
| flush | Delete local git repository folders |
___ ___