SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Filterscripts > Tools and Files

Reply
 
Thread Tools Display Modes
Old 13/05/2017, 07:40 PM   #1
Michael@Belgium
High-roller
 
Michael@Belgium's Avatar
 
Join Date: Dec 2010
Location: Belgium
Posts: 3,050
Reputation: 1000
Exclamation [MV]_AutoDeploy - Use git to your advantage to auto-update your sa-mp server on your vps from local!

Ah man, how much I wanted this... I'm so relieved. Finally I've made it to work, and well here you guys have it too!

Information

So this is a mix of files/release that will make your developing easier (well, in my opinion). By doing one git command your server will update automaticly on your vps/dedicated server.
Just the fact that you don't need to upload new .amx every time and need to edit your /updates command ... or like people saying "what's new?"

This is all not needed anymore!

It works like this; you push your update to your remote, bitbucket will send info to your vps saying the script is updated, your vps will update the gamemode files, your database will get updated and later your server will check if there's a new commit hash than before. If yes, the samp server will automaticly update/restart

Media





How to

Github/download
__________________
Mah Github. - Mah Youtube
Interested in a full featured and cheap derby gamemode or need host-tab ? Contact me on skype: michael.belgium

Last edited by Michael@Belgium; 15/07/2017 at 04:30 PM.
Michael@Belgium is offline   Reply With Quote
Old 13/05/2017, 08:34 PM   #2
iLearner
Huge Clucker
 
iLearner's Avatar
 
Join Date: Apr 2017
Posts: 362
Reputation: 78
Default Re: [MV]_AutoDeploy - Use git to your advantage to auto-update your sa-mp server on your vps from local!

It's cool, but to be honest I wont be using it... direct way is way easier you know.
__________________
iLearner is online now   Reply With Quote
Old 15/05/2017, 10:05 AM   #3
Gamer_Z
High-roller
 
Gamer_Z's Avatar
 
Join Date: Jun 2009
Location: Eindhoven, NL
Posts: 3,608
Reputation: 1354
Default Re: [MV]_AutoDeploy - Use git to your advantage to auto-update your sa-mp server on your vps from local!

Quote:
Originally Posted by iLearner View Post
It's cool, but to be honest I wont be using it... direct way is way easier you know.
depends. When I had a server I let it restart at 02:00 am each day by pulling all updates in and automatically recompiling my mode.

My workflow was:

1) Write code
2) test
3) commit & push
4) goto 1

Never had to touch the server, even crashdumps were automatically uploaded, which means I never had to ssh/rdp into the server and could do everything from my local pc (thanks to git).

Without git:

1) Write code
2) test
3) recompile the mode yourself
4) connect to server console (be it ssh or rdp)
5) shutdown server
6) replace binaries
7) start server
8.a) if everything works goto 1, else:
8.b) crash
9) find and download crashdump
10) goto 1)

You are probably using git anyway (or svn for the ones in the stone age) which means you are uploading your code twice, which sucks on slow connections. And that's why you want to automate the process. Great to see someone released a howto on this.

Ofcourse my tip would be to make it a cronjob instead of an php file that ssh's to a server, the server should do it itself. Git has commands to check if there are commits to be pulled. Would also be way more secure.. don't trust php.
__________________

Do not contact me for private help, please stop wasting your time trying to offer me a job
(Especially if you cannot pay the market rate for a developer)
If you are looking for scripters/mappers/staff/whatever look here
The only help I offer is my occasional reaction on the public forums

Last edited by Gamer_Z; 15/05/2017 at 10:47 AM.
Gamer_Z is offline   Reply With Quote
Old 15/05/2017, 10:22 AM   #4
iLearner
Huge Clucker
 
iLearner's Avatar
 
Join Date: Apr 2017
Posts: 362
Reputation: 78
Default Re: [MV]_AutoDeploy - Use git to your advantage to auto-update your sa-mp server on your vps from local!

Quote:
Originally Posted by Gamer_Z View Post
depends. When I had a server I let it restart at 02:00 am each day by pulling all updates in and automatically recompiling my mode.

My workflow was:

1) Write code
2) test
3) commit & push
4) goto 1

Never had to touch the server, even crashdumps were automatically uploaded, which means I never had to ssh/rdp into the server and could do everything from my local pc (thanks to git).

Without git:

1) Write code
2) test
3) recompile the mode yourself
4) connect to server console (be it ssh or rdp)
5) shutdown server
6) replace binaries
7) start server
8.a) if everything works goto 1, else:
8.b) crash
9) find and download crashdump
10) goto 1)

You are probably using git anyway (or svn for the ones in the stone age) which means you are uploading your code twice, which sucks on slow connections. And that's why you want to automate the process. Great to see someone released a howto on this.

Ofcourse my tip would be to make it a cronjob insteado f an php file that ssh's to a server, the server should do it itself. Git has commands to check if there are commits to be pulled. Would also be way more secure.. don't trust php.
Convincing, might give it a try.
__________________
iLearner is online now   Reply With Quote
Old 15/05/2017, 11:25 AM   #5
nGen.SoNNy
Gangsta
 
nGen.SoNNy's Avatar
 
Join Date: Sep 2009
Location: Romania
Posts: 992
Reputation: 65
Default Re: [MV]_AutoDeploy - Use git to your advantage to auto-update your sa-mp server on your vps from local!

I was trying to do this but thanks for your tutorial!
__________________
If i've helped you, please click
nGen.SoNNy is offline   Reply With Quote
Old 15/05/2017, 11:45 AM   #6
YouHack
Huge Clucker
 
Join Date: Jan 2017
Posts: 266
Reputation: 21
Default Re: [MV]_AutoDeploy - Use git to your advantage to auto-update your sa-mp server on your vps from local!

if it was just a Y_INI file to read from it updates ^^ and write to it in-game would be useful
YouHack is offline   Reply With Quote
Old 15/07/2017, 04:32 PM   #7
Michael@Belgium
High-roller
 
Michael@Belgium's Avatar
 
Join Date: Dec 2010
Location: Belgium
Posts: 3,050
Reputation: 1000
Default Re: [MV]_AutoDeploy - Use git to your advantage to auto-update your sa-mp server on your vps from local!

Using y_ini would be a bad practice lol, I don't like to use files when SQL is so much easier to use
__________________
Mah Github. - Mah Youtube
Interested in a full featured and cheap derby gamemode or need host-tab ? Contact me on skype: michael.belgium
Michael@Belgium is offline   Reply With Quote
Old 15/07/2017, 04:42 PM   #8
Meller
Huge Clucker
 
Join Date: Dec 2016
Posts: 235
Reputation: 39
Default Re: [MV]_AutoDeploy - Use git to your advantage to auto-update your sa-mp server on your vps from local!

I love you.
__________________
Quote:
Originally Posted by Crystallize
Quote:
Originally Posted by Meller View Post
I thought you were supposed to work at the job?
quote spree
Meller is offline   Reply With Quote
Old 21/07/2017, 06:21 AM   #9
Chaprnks
Gangsta
 
Chaprnks's Avatar
 
Join Date: Sep 2007
Location: Soviet America
Posts: 653
Reputation: 41
Default Re: [MV]_AutoDeploy - Use git to your advantage to auto-update your sa-mp server on your vps from local!

I love this! I like to think of it like a much simpler form of sampctrl.

Although, I'm having some issues getting the callbacks to be triggered.

- deploy.php is hosted on the domain & configured
- webhook on github repo is configured to the php file above
- examplescript.pwn is in the gamemode

When you say, create an empty repository in the gamemodes directory; are you referring to adding the .amx to the repo, or putting the .pwn's; in combination with the .amx?
__________________
Chaprnks is offline   Reply With Quote
Old 06/08/2017, 09:37 PM   #10
Michael@Belgium
High-roller
 
Michael@Belgium's Avatar
 
Join Date: Dec 2010
Location: Belgium
Posts: 3,050
Reputation: 1000
Default Re: [MV]_AutoDeploy - Use git to your advantage to auto-update your sa-mp server on your vps from local!

Quote:
Originally Posted by Chaprnks View Post
When you say, create an empty repository in the gamemodes directory; are you referring to adding the .amx to the repo, or putting the .pwn's; in combination with the .amx?
If you are talking about locally then minimum the .amx so u can push to the origin and then the webhook can get it
__________________
Mah Github. - Mah Youtube
Interested in a full featured and cheap derby gamemode or need host-tab ? Contact me on skype: michael.belgium
Michael@Belgium is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto Update CoR3 Scripting Help 1 28/12/2014 09:56 AM
Auto Update (Suggestion) Saurik General 44 12/05/2012 12:41 PM
Using LAN to my advantage Infinity Everything and Nothing 6 14/03/2012 08:44 PM
Auto Update? TheJayMan Scripting Help 2 01/10/2011 10:46 PM
MySQL auto update or something. KaleOtter Help Archive 10 18/05/2011 12:49 PM


All times are GMT. The time now is 06:56 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.