Alrighty, here is the process I use to automate a complete backup, update, recompile and commit. Bare with me as I have never written a guide for anything of this nature as I consider myself still a novice when it comes to this kind of thing. I will try to do my best and make it as uncomplicated as possible.
I use 7 folders to produce the results from this .bat. A character backup folder, a settings backup folder, a darkstar clone backup folder, a server backup folder, an auto pull folder, an auto commit folder and of course the actual darkstar folder used to install and run your server. Anyone who wishes to use this will have some minor editing to do but I entered in the instructions of what goes where after the "=" in the top of the script section. That being said there are a few things to remember as you navigate your way through here:
- at the end of this guide are links to setup remote paths as well as generating keys to allow this process to execute properly without entering in username, password, or passphrase
- you only need to change the values after the "=" sign and the code will do the rest. ie: SET CHARACTER BACKUP FOLDER=(C:\Users\YOU\EDIT\THIS\PATH\TO\YOUR\FOLDER)
- deleting any of these line commands could potentially break your process, so try to leave the code intact minus the editing you must do
- you need to have a folder corresponding to the various paths to run this, otherwise it will not cycle through the whole process, the folders are as follows; Character Backup Folder, Darkstar Install Folder, Settings Backup Folder, Server Backup Folder, Darkstar Clone Backup Folder, Auto Pull Folder, and Auto Commit Folder
- copy and paste from "Start Copy" down to "End Copy" in this post into notepad
- once your values have been edited you must save the file as a .bat, then its just a one click and walk away till its finished (start to finish is approximately 10 minutes or less for the whole process)
- at the end of this code I will also be including another code for auto pulling and auto committing and auto pulling that should be saved as .sh files
- when setting up your final commit DO NOT USE HTTPS://
GIT@GITHUB.COM:DARKSTARPROJECT/DARKSTAR AS YOUR COMMIT ADDRESS (I would assume it is password protected but none the less when you push your commit it MUST BE YOUR REPOSITORY)
@ECHO "START COPY"
SET SERVER PASSWORD=SERVER PASSWORD
SET CHARACTER BACKUP FOLDER=PATH TO CHARACTER BACKUPS FOLDER
SET DARKSTAR INSTALL FOLDER=PATH TO SERVER INSTALL FOLDER
SET SETTINGS BACKUP FOLDER=PATH TO SETTINGS BACKUPS FOLDER
SET SERVER BACKUP FOLDER=PATH TO SERVER BACKUP FOLDER
SET DARKSTAR CLONE BACKUP FOLDER=PATH TO DARKSTAR CLONE BACKUP FOLDER
SET AUTO PULL FOLDER=PATH TO AUTO PULL FOLDER
SET AUTO COMMIT FOLDER=PATH TO AUTO COMMIT FOLDER
@ECHO "Character And Settings Backup"
c:
cd C:\Program Files\MySQL\MySQL Server 5.6\bin
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb auction_house > "%CHARACTER BACKUP FOLDER%\auction_house.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb accounts > "%CHARACTER BACKUP FOLDER%\accounts.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb accounts_banned > "%CHARACTER BACKUP FOLDER%\accounts_banned.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb char_effects > "%CHARACTER BACKUP FOLDER%\char_effects.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb char_equip > "%CHARACTER BACKUP FOLDER%\char_equip.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb char_exp > "%CHARACTER BACKUP FOLDER%\char_exp.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb char_inventory > "%CHARACTER BACKUP FOLDER%\char_inventory.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb char_jobs > "%CHARACTER BACKUP FOLDER%\char_jobs.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb char_look > "%CHARACTER BACKUP FOLDER%\char_look.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb char_pet > "%CHARACTER BACKUP FOLDER%\char_pet.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb char_pet_name > "%CHARACTER BACKUP FOLDER%\char_pet_name.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb char_points > "%CHARACTER BACKUP FOLDER%\char_points.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb char_profile > "%CHARACTER BACKUP FOLDER%\char_profile.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb char_skills > "%CHARACTER BACKUP FOLDER%\char_skills.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb char_stats > "%CHARACTER BACKUP FOLDER%\char_stats.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb char_storage > "%CHARACTER BACKUP FOLDER%\char_storage.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb char_vars > "%CHARACTER BACKUP FOLDER%\char_vars.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb char_weapon_skill_points > "%CHARACTER BACKUP FOLDER%\char_weapon_skill_points.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb chars > "%CHARACTER BACKUP FOLDER%\chars.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb conquest_system > "%CHARACTER BACKUP FOLDER%\conquest_system.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb delivery_box > "%CHARACTER BACKUP FOLDER%\delivery_box.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb linkshells > "%CHARACTER BACKUP FOLDER%\linkshells.sql"
mysqldump.exe -e -uroot -p%SERVER PASSWORD% dspdb > "%CHARACTER BACKUP FOLDER%\dspdb.sql"
C:
CD "%DARKSTAR INSTALL FOLDER%\darkstar\conf"
xcopy /s/q/y "%DARKSTAR INSTALL FOLDER%\darkstar\conf\lan_config.conf" "%SETTINGS BACKUP FOLDER%"
xcopy /s/q/y "%DARKSTAR INSTALL FOLDER%\darkstar\conf\login_darkstar.conf" "%SETTINGS BACKUP FOLDER%"
xcopy /s/q/y "%DARKSTAR INSTALL FOLDER%\darkstar\conf\map_darkstar.conf" "%SETTINGS BACKUP FOLDER%"
xcopy /s/q/y "%DARKSTAR INSTALL FOLDER%\darkstar\conf\packet_darkstar_tcp.conf" "%SETTINGS BACKUP FOLDER%"
xcopy /s/q/y "%DARKSTAR INSTALL FOLDER%\darkstar\conf\packet_darkstar_udp.conf" "%SETTINGS BACKUP FOLDER%"
xcopy /s/q/y "%DARKSTAR INSTALL FOLDER%\darkstar\conf\search_server.conf" "%SETTINGS BACKUP FOLDER%"
xcopy /s/q/y "%DARKSTAR INSTALL FOLDER%\darkstar\conf\server_message.conf" "%SETTINGS BACKUP FOLDER%"
xcopy /s/q/y "%DARKSTAR INSTALL FOLDER%\darkstar\conf\server_message_fr.conf" "%SETTINGS BACKUP FOLDER%"
C:
CD "%DARKSTAR INSTALL FOLDER%\darkstar\scripts\globals"
xcopy /s/q/y "%DARKSTAR INSTALL FOLDER%\darkstar\scripts\globals\settings.lua" "%SETTINGS BACKUP FOLDER%"
@ECHO "Shadowlyre Server Backup"
C:
cd "%DARKSTAR INSTALL FOLDER%"
xcopy /s/q/y "%DARKSTAR INSTALL FOLDER%" "%SERVER BACKUP FOLDER%"
@ECHO "Darkstar Database Update"
C:
cd "%DARKSTAR CLONE BACKUP FOLDER%"
call "%AUTO PULL FOLDER%\Darkstar_Pull_Request.sh"
@ECHO "Shadowlyre Server Update"
C:
cd "%DARKSTAR INSTALL FOLDER%"
call "%AUTO PULL FOLDER%\Server_Pull_Request.sh"
@ECHO "Shadowlyre Server Rebuild"
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" "%DARKSTAR INSTALL FOLDER%\darkstar\win32\darkstar.sln" /p:Configuration=DEBUG
@ECHO "Character And Settings Restore"
C:
CD "%CHARACTER BACKUP FOLDER%"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\auction_house.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\accounts.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\accounts_banned.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\char_effects.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\char_equip.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\char_exp.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\char_inventory.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\char_jobs.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\char_look.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\char_pet.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\char_pet_name.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\char_points.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\char_profile.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\char_skills.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\char_stats.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\char_storage.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\char_vars.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\char_weapon_skill_points.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\chars.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\conquest_system.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\delivery_box.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\linkshells.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
xcopy /s/q/y "%CHARACTER BACKUP FOLDER%\dspdb.sql" "%DARKSTAR INSTALL FOLDER%\darkstar\sql"
C:
CD "%SETTINGS BACKUP FOLDER%"
xcopy /s/q/y "%SETTINGS BACKUP FOLDER%\lan_config.conf" "%DARKSTAR INSTALL FOLDER%\darkstar\conf"
xcopy /s/q/y "%SETTINGS BACKUP FOLDER%\login_darkstar.conf" "%DARKSTAR INSTALL FOLDER%\darkstar\conf"
xcopy /s/q/y "%SETTINGS BACKUP FOLDER%\map_darkstar.conf" "%DARKSTAR INSTALL FOLDER%\darkstar\conf"
xcopy /s/q/y "%SETTINGS BACKUP FOLDER%\packet_darkstar_tcp.conf" "%DARKSTAR INSTALL FOLDER%\darkstar\conf"
xcopy /s/q/y "%SETTINGS BACKUP FOLDER%\packet_darkstar_udp.conf" "%DARKSTAR INSTALL FOLDER%\darkstar\conf"
xcopy /s/q/y "%SETTINGS BACKUP FOLDER%\search_server.conf" "%DARKSTAR INSTALL FOLDER%\darkstar\conf"
xcopy /s/q/y "%SETTINGS BACKUP FOLDER%\server_message.conf" "%DARKSTAR INSTALL FOLDER%\darkstar\conf"
xcopy /s/q/y "%SETTINGS BACKUP FOLDER%\server_message_fr.conf" "%DARKSTAR INSTALL FOLDER%\darkstar\conf"
xcopy /s/q/y "%SETTINGS BACKUP FOLDER%\settings.lua" "%DARKSTAR INSTALL FOLDER%\darkstar\scripts\globals"
@ECHO "Shadowlyre Server Commit"
C:
cd "%AUTO COMMIT FOLDER%"
call "%AUTO COMMIT FOLDER%\Server_Commit.sh"
@ECHO "END COPY"
The following codes needs to be saved as a .sh file in your auto pull folder so your call knows where it is to run the commands to auto pull. Please note that you need to create 2 separate .sh files in this section. One to point to your server install and one to point to your clone backup. These should be named to mirror the respective .sh files in sections "Darkstar Database Update" and "Server Update".
----------
.SH FILE 1
----------
SET DARKSTAR INSTALL FOLDER=PATH TO SERVER INSTALL FOLDER
cd "%DARKSTAR INSTALL FOLDER%\darkstar"
git init
git status
git remote add upstream "
http://github.com/DarkstarProject/darkstar.git"
git pull remote upstream master
----------
.SH FILE 2
----------
SET DARKSTAR CLONE BACKUP FOLDER=PATH TO DARKSTAR CLONE BACKUP FOLDER
cd "%DARKSTAR CLONE BACKUP FOLDER%\darkstar"
git init
git status
git remote add upstream "
http://github.com/DarkstarProject/darkstar.git"
git pull remote upstream master
The following code needs to be saved as a .sh file in your auto commit folder so your call knows where it is to run the commands to auto commit:
SET DARKSTAR INSTALL FOLDER=PATH TO SERVER INSTALL FOLDER
cd "%DARKSTAR INSTALL FOLDER%"
git init
git status
git add -A
git commit -am 'Auto Commit'
git remote add origin "
git@github.com:<YOURUSERNAME:YOUR REPOSITORY>.git"
git push origin master
Now before you run the whole process you will need to follow the steps in these guides to get everything setup properly:
viewtopic.php?f=11&t=2568
https://help.github.com/articles/generating-ssh-keys/
If anyone has any questions hit me up and I will do my best to assist.