Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Ligonsker's avatar

Need help with making a better procedure to maintain and deploy the app

Hello,

Where I work right now there are only inexperienced developers left. The way things work there in terms of development is this:

There are 2 Windows Servers: Test and Production There is GitLab for the repository with only 1 master branch

The other two developers develop on their local machines, then commit and push to origin master on GitLab.

Then in order to test things, they copy the repository folder to the Test server using RDP.

If tests are successful, they just copy it to the Production server via RDP again.

I also do not have much experience but last workplace it was much better procedure but I don't know how to set it up.

What should I do to make things work better? Even few steps to just get things going is good

Of course nobody cares right now since it's a new system for internal use and the manager does not come from the software world so he's unaware of that. But I know this is just wrong. It's worse than how I was developing my own "projects" at home

0 likes
11 replies
Sinnbeck's avatar

Can I start by asking why it is running on windows servers? They are way more expensive than Linux servers and aren't built to run php

Any chance they would allow you to use a real Linux server with a company like digitalocean or similar? They cost almost nothing

1 like
Ligonsker's avatar

@Sinnbeck True, this might be my next plan. Could be because they're inexperienced with these OS. And Windows is easier with the GUI and everything. Also if I recall, you can't have Queues on Windows Server for Jobs right?

However it's a large financial company so I have to see if it's even an option.. They have enough money so I don't think money is the problem for them in terms of using Windows machines so they don't care

If we go Linux, what would you recommend then? Out GitLab seem to have CI/CD tool but I never used it. And also Jira maybe since it's the same company. But maybe there is better workflow?

Sinnbeck's avatar

@Ligonsker I might not be the best to ask as I work alone, but I can describe how I work if it helps

I use feature branches to build new features. When I am happy and all tests are green I merge them into main. I use github for git and github actions testing before deployment. For large projects I run my own jenkins server for tests.

I set up servers using ploi (same as forge but in Europe). I also use it to manage the server, queues, cron etc.

I run my servers on hetzner cloud as it's cheap and EU based

1 like
Ligonsker's avatar

@Sinnbeck Exactly what we were doing on the previous workplace. It was very easy to do with Jira, you make branches there then push to master and the more experienced devs were responsible for accepting or rejecting merges.

I will need to see if we can deploy Jenkins. I noticed GitLab has its own CI/CD tool when I open the repo on the navbar - there's "CI/CD'" link and when I click it says something about creating pipelines. I've never done anything like that (Jenkins, CI/CD), so I have no idea what it does or how to do it. Will have to see docs/videos.

Can you please explain in short what is the responsibility of Jenkins and how it works before I go read? Is it a tool you install on another server and before deploying your repo to production it has tests you defined and if everything passes, it just updates the repo in the deployment server where it needs to be (for example updating files on /var/www)? Does it require downtime? I.E for the time of copying the updated repo the website shuts down for a few seconds?

Sinnbeck's avatar

@Ligonsker jenkins is just a free self hosted testing and ci platform. But I use github actions for 99% of my projects as I don't need anything more. I'm sure the ci feature in gitlab is fine as well, but I have never used it (never used gitlab either). There are other tools as well (even one built for laravel but I can't recall the name)

I always use zero downtime deployment. Ploi has this as a build in feature (1 checkbox and it works). But the essence is to deploy to a completely new folder (timestamp as name) and then when it's ready you update a symlink from the "real" path to the new folder and restart php. I've written this myself in the past

1 like
Ligonsker's avatar

@Sinnbeck Nice this is pretty neat. Are you using Apache or nginx?

So for example you configured your server to serve fromvar/www which will be defined as symlink to deployments/1661019072/ folder in another place. Then you copy 1661019191/ to deployments/ and switch to serve from it? I guess you also keep the previous deployments until certain time or storage is reached just in case you want to revert? What did you use to write this script? shell script?

Sinnbeck's avatar

@Ligonsker I use nginx and have so for the last 5 years. I used apache2 before that.

Before switching to ploi I used envoy https://laravel.com/docs/9.x/envoy

Here is an example script by spatie (probably written by Freek) that does exactly what I describe https://github.com/spatie/freek.dev/blob/main/Envoy.blade.php

Be aware that I use symlink, not copy. And yeah I normally have 5 releases so I can in theory roll back to a previous release

1 like
Sinnbeck's avatar

@Ligonsker happy to help. Let me know if you need further explanation on some point. It was quite daunting for me to figure it all out myself so I know the journey :)

1 like
Ligonsker's avatar

@Sinnbeck I will first have to figure out what options I am allowed to use. If you remember from my previous post, this place is very restricted with new software :/

Please or to participate in this conversation.