Attempting to automate commit using a .bat

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Attempting to automate commit using a .bat

Post by kjLotus » Sun Jul 26, 2015 4:54 pm

you can pull from any branch, all it does it grab the commits you don't have and merge them in

Crosine
Posts: 49
Joined: Wed Sep 10, 2014 9:32 pm

Re: Attempting to automate commit using a .bat

Post by Crosine » Sun Jul 26, 2015 5:40 pm

I have edited the line cmd in the overall script to use git pull instead of completely re-cloning which cut down on the time it takes to run the entire script start to finish considerably. I assume it is fully working as when I ran the .bat it gave me the same message in the cmd window as it did when I tried to do it manually. Thanks for the advice Lotus as this will make it even easier for people to automate the whole process and they can focus less on clicking buttons and more on scripting, compiling etc. If there are any issues with the code not working on your end feel free to get in touch with me and I will do my best to help you resolve it. Thanks again everyone and until next time stay awesome 8-)

User avatar
demolish
Developer
Posts: 262
Joined: Thu Jul 26, 2012 7:12 am

Re: Attempting to automate commit using a .bat

Post by demolish » Sun Jul 26, 2015 6:33 pm

would be worth using variables (define them at the start of the script)
e.g.
SET mysqluser="root"
SET mysqlpass="pass"
SET dspPath="path\to\dsp"
SET backup="path\to\backup"

and use %variable% (variable being something 'SET' e.g 'dspPath' in the above example so %dspPath%) in place of where you currently have 'YOUR_STUFF_HERE' (or whatever you called it)
<Giblet[NewBrain]> kj with this first step would be fine on my shit
Click here for a guide on scripting missions.

Crosine
Posts: 49
Joined: Wed Sep 10, 2014 9:32 pm

Re: Attempting to automate commit using a .bat

Post by Crosine » Sun Jul 26, 2015 11:18 pm

Holy shit batman! I didn't even realize you could do that, its pretty freakin cool. :lol: Thanks for the advice, I have re-edited the post to reflect those changes. Hopefully this will be able to help someone as I am proud that it made it this far. Thanks again everyone!

Delaide
Posts: 478
Joined: Sat Jun 14, 2014 8:58 am

Re: Attempting to automate commit using a .bat

Post by Delaide » Sun Jul 26, 2015 11:40 pm

Just remember to share the code :o
Well, up to you, but better that way ^.^

User avatar
demolish
Developer
Posts: 262
Joined: Thu Jul 26, 2012 7:12 am

Re: Attempting to automate commit using a .bat

Post by demolish » Mon Jul 27, 2015 5:50 am

variables' names cannot contain spaces, use camelCase or snake_case e.g.
SET gitUserName="root"
or
SET path_to_dsp_folder="path\to\dsp\folder"
<Giblet[NewBrain]> kj with this first step would be fine on my shit
Click here for a guide on scripting missions.

Crosine
Posts: 49
Joined: Wed Sep 10, 2014 9:32 pm

Re: Attempting to automate commit using a .bat

Post by Crosine » Mon Jul 27, 2015 6:31 pm

I will have to double check the code running on my system but I do believe it is working as how I have it laid out when using SET CHARACTER BACKUP=C:\Users\YOU\EDIT\THIS\PATH\TO\YOUR\FOLDER for example. The first part contains spaces, while anything after is all directly connected without spacing as it is the path to your file folder. I did tested it 3-4 times and it cycled through every time without fail before I edited the post to reflect the variable changes, just so I could be sure that it was confirmed working. In the script itself however I did include the quotation marks around the %variable% portions so maybe that has something to do with it as it is telling each variable that is replaced to be included as a phrase that can include spaces. (Was reading somewhere online that spacing was possible as long as there were quotations around the string) Not sure if it functions that way because it is a .bat file or not. But as long as your second part is directly behind the = sign it should function the same way as it does on my system. Just in case though if anyone else is brave enough to try it out and let me know for sure that would be awesome. :D I will test it out on my rig once more just to confirm. If anything seems amiss I will edit the post asap.

Crosine
Posts: 49
Joined: Wed Sep 10, 2014 9:32 pm

Re: Attempting to automate commit using a .bat

Post by Crosine » Mon Jul 27, 2015 6:47 pm

Okay, I just ran the process again on my server and it cycled through as expected. So I can verify that all you need to do is alter the section after the = sign using your file path to each individual folder. I am not saying you are incorrect Demolish just that in this code for whatever crazy reason is working. :lol: As long as you use the guides to properly setup and save your github username, password, and passphrase, as well as properly setting up your remote origin master and remote upstream master everything will function correctly. Now that being said I haven't done any major coding to the game script, so if there are any specific options to submitting those changes to the master Darkstar repository I will cross that bridge when I come to it. (One step at a time! :shock: ) So until next time take it easy everyone and enjoy!

User avatar
demolish
Developer
Posts: 262
Joined: Thu Jul 26, 2012 7:12 am

Re: Attempting to automate commit using a .bat

Post by demolish » Tue Jul 28, 2015 9:31 am

oh, nevermind then
i always hated bat scripts anyways, fkin weirdos
<Giblet[NewBrain]> kj with this first step would be fine on my shit
Click here for a guide on scripting missions.

LordAxion
Posts: 6
Joined: Wed Aug 26, 2015 11:30 pm

Re: Attempting to automate commit using a .bat

Post by LordAxion » Wed Oct 14, 2015 2:47 pm

Hello, I have a Question, are you running this from Windows or Ubuntu? I have Servers On both OS, and I am Specifically looking for Something for Ubuntu, IF it works for Windows too, thats a bonus. lol.

ps Note** I am very new to Ubuntu

Post Reply