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, 08:40 PM   #1
[email protected]
High-roller
 
Michael@Belgium's Avatar
 
Join Date: Dec 2010
Location: Belgium
Posts: 3,041
Reputation: 1001
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 [email protected]; 15/07/2017 at 05:30 PM.
Michael@Belgium is offline   Reply With Quote
Old 13/05/2017, 09:34 PM   #2
iLearner
Banned
 
Join Date: Apr 2017
Posts: 434
Reputation: 89
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 offline   Reply With Quote
Old 15/05/2017, 11:22 AM   #3
iLearner
Banned
 
Join Date: Apr 2017
Posts: 434
Reputation: 89
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 offline   Reply With Quote
Old 15/05/2017, 12:25 PM   #4
nGen.SoNNy
High-roller
 
nGen.SoNNy's Avatar
 
Join Date: Sep 2009
Location: Romania
Posts: 1,001
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, 12:45 PM   #5
YouHack
Huge Clucker
 
Join Date: Jan 2017
Posts: 275
Reputation: 22
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, 05:32 PM   #6
[email protected]
High-roller
 
Michael@Belgium's Avatar
 
Join Date: Dec 2010
Location: Belgium
Posts: 3,041
Reputation: 1001
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, 05:42 PM   #7
Meller
Gangsta
 
Meller's Avatar
 
Join Date: Dec 2016
Posts: 558
Reputation: 90
Default Re: [MV]_AutoDeploy - Use git to your advantage to auto-update your sa-mp server on your vps from local!

I love you.
Meller is offline   Reply With Quote
Old 21/07/2017, 07:21 AM   #8
Chaprnks
Gangsta
 
Chaprnks's Avatar
 
Join Date: Sep 2007
Location: Soviet America
Posts: 674
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, 10:37 PM   #9
[email protected]
High-roller
 
Michael@Belgium's Avatar
 
Join Date: Dec 2010
Location: Belgium
Posts: 3,041
Reputation: 1001
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
Old 22/08/2017, 12:54 AM   #10
azzerking
Gangsta
 
azzerking's Avatar
 
Join Date: Dec 2009
Location: England, Leicestershire
Posts: 496
Reputation: 70
Default Re: [MV]_AutoDeploy - Use git to your advantage to auto-update your sa-mp server on your vps from local!

This actually interested me, but I found a few issues that requires people to have to manually edit it.

1. You only support SSH with passwords, if you are in anyway smart about how you setup your server you would be using SSH private keys. (So make it optional, to choose between them)

2. When you push to your repository, are we supposed to compile the script pre-push? or would you go through the trouble of maybe making the script compile upon syncing the script across?

I was actually about to do something similar, where I would push to the repository and have my test-server pull it, compile it and run it, as well as compile any plugin I made. Then when done push it to the production server.

I would like to see an option to compile the script on another server if the user wanted it. Would be very helpful for those who do not compile locally, like me.

Although as it stands, I do like the process you have taken to accomplish this, good work.
__________________


Web Skill: PHP, HTML, CSS, JS, RUBY, NODE.js.

Programing Skill: Objective C, C#, C++, D#, Python, Java, MySQL.

OS Skill: Windows (95 - 10), Ubuntu/Debian, Raspbian, Kali, Arch, Unix, Mac (E-MACs - Current)

Scripting Skill: LUA, Pawn, C38*
azzerking 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 10:56 AM
Auto Update (Suggestion) Saurik General 44 12/05/2012 01:41 PM
Using LAN to my advantage Infinity Everything and Nothing 6 14/03/2012 09:44 PM
MySQL auto update or something. KaleOtter Help Archive 10 18/05/2011 01:49 PM


All times are GMT. The time now is 06:14 PM.


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