Hello There, Guest! Login or Register


Tutorial: How to deploy Las Venturas Playground to the (test)server
#1
Tutorial: How to deploy Las Venturas Playground to the (test)server
If you're willing to test your latest build with other players, or if your new feature requires a connection to the database to work, or if you're pushing a new version to the production server, you may want to know how to correctly deploy Las Venturas Playground.

Necessary software
To deploy your build, you'll need a FTP client and a SSH client. In this tutorial, we'll use FileZilla and PuTTY. Both of them are completely free and run on Windows.

Deploying the gamemode
First of all, we'll have to upload your build to the (test)server through FTP. Start FileZilla and connect to the Las Venturas Playground (test)server. To do that, enter the FTP credentials in the Quickconnect panel and then click Quickconnect.
Note: you can find the testserver FTP credentials in the Resources topic.

[Image: deploy-ftp-quickconnect.png]

Once you're connected, browse through the directories and get to the gamemodes folder. It should be located in the Server folder. You'll find a few files here. One of them is lvp.amx, which is the build the (test)server is currently running on.

If you're deploying a build to the testserver, you can simply ZIP your lvp.amx and upload the lvp.zip file to the gamemodes folder - just drag and drop it. If asked, overwrite the existing archive.

[Image: deploy-ftp-lvp-zip-dragdrop.png]

The same goes if you're deploying a build to the production server. In this case, though, you'll have to make sure to rename the existing lvp.amx, so we won't overwrite it when we unzip the archive we've just uploaded. This is very important in case something's wrong with the new build and we have to rollback to the latest working gamemode file.

Don't worry, the server won't shutdown if you rename the gamemode file during runtime, but we should make sure to have a lvp.amx by the time we restart the server.

Once we've uploaded the lvp.zip archive which contains the Las Venturas Playground build, lvp.amx, we'll have to access the (test)server through SSH. Start the SSH client, PuTTY, and fill in the form with the (test)server IP address and port like shown in the following picture. Then click Open.

[Image: deploy-ssh-connect.png]

Once you've clicked open, you should see a terminal window open. You'll be asked for credentials; if you're deploying to the testserver, use testserver as username, while if you're pushing a new version to the production server, type in samp. Press Enter; you'll now be asked for the password. You won't be able to see it while you're typing, but no worries. Once you're done, press Enter again. If everything went fine, you should see something like this.

[Image: deploy-ssh-connected.png]

Note: you can find the testserver SSH credentials in the Resources topic as well.

We're now connected to the (test)server through SSH. Let's browse to the gamemodes folder. To do that, we can use the cd command (it stands for change directory). Given that the folder we're looking for is located in Server, we may type cd Server/gamemodes.

Once we're here, we'll have to unzip the lvp.zip archive we've uploaded through FTP. Let's use the unzip command: unzip lvp.zip. If asked whether to overwrite the existing lvp.amx, type y to go ahead.

[Image: deploy-ssh-unzip-archive.png]

Alright, now that we have our own build up, we have to restart the server to make it live. We should now check if the server is running, and if so, kill it and then restart it. If the (test)server's already down, we'll just start it again.

To check whether the (test)server process is up and running, we'll use the ps command (which stands for process status). If you're checking whether the testserver is running, use ps aux | grep testserver, while if you're looking for the production server process, use ps aux | grep samp.

We'll be shown a list of running processes. We're looking for a process called samp03svr (production server process) or samp03test (testserver process), as shown in the image. Once we find it, we shall look at the second number displayed on the same line: it is the (test)server's process Id (or pid). Note that if you don't find the process, it's probably because the server is already down. If so, skip this step.

To shutdown the (test)server before restarting it, we'll have to execute the kill command, using the (test)server process Id: kill -9 [pid] - have a look at the example:

[Image: deploy-ssh-kill-server.png]

The server is now shutdown, and we have to restart it. To do that, we can use the start.sh shell script located in the Server folder. To go up a level in the directory tree, we shall use cd .. and then, to run the shell script, ./start.sh like shown in the following image.

[Image: deploy-ssh-restart-server.png]

The server should be now running!

In a nutshell...

The whole process may seem quite complicated, but once you get the hang of it, it becomes quite an easy task. We can sum it up in five steps:

1. Compile the gamemode, and create a ZIP archive containing the build file, lvp.amx;
2. Upload the ZIP archive, lvp.zip, to the gamemodes folder of the (test)server;
3. Unzip the lvp.zip archive in the gamemodes folder;
4. Check forĀ  the current server process and, if any, kill it;
5. Start the server through the start.sh shell script.

If everything went as expected, the (test)server should be up and running with your new gamemode. In case you're running into trouble, poke another developer on IRC and explain the issues you're experiencing. We'll be able to help! Happy deployment!
Reply