[Tool/Web/Other] [MV]_AutoDeploy - Use git to your advantage to auto-update your sa-mp server on your vps from local!
#1

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
Reply
#2

It's cool, but to be honest I wont be using it... direct way is way easier you know.
Reply
#3

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.
Reply
#4

I was trying to do this but thanks for your tutorial!
Reply
#5

if it was just a Y_INI file to read from it updates ^^ and write to it in-game would be useful
Reply
#6

Using y_ini would be a bad practice lol, I don't like to use files when SQL is so much easier to use
Reply
#7

I love you.
Reply
#8

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?
Reply
#9

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
Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)