0

I know this has been asked before, I wasn't able to find a solution for my situation. I am just hoping to get some insight from the community.


Basically, I want to use gitlab for a web application (html,php,mysql) I have been working on. I have been using FTP in a team of 3-4 people for a year and I'm trying to switch over to gitlab. We have a local community version of the software running. I have been able to setup the hook to upload the files to the live website when we commit or push.

Here's where I'm stuck;

  1. How can I still develop the web application at the speed I was with FTP?
  2. Do I need to have a local web server running on everyone's computer who is working on the development?
  3. The web application is configured to work on a specific domain with url rewrites. If I change that and then commit my changes it would break the live site. Do I just exclude syncing of config files?
  4. If we make a database change, what's the best practice to get that updated on the production server? Do we need to write an "upgrade" script to handle that?

Debugging is a pain if I need to write some code, then push to a dev server and wait for the hook to fire. That's 1-3 minutes where it used to take 1-3 seconds. Then once we're done we commit to the production server. I feel like I'm missing something here.

1 Answer 1

1
  1. Introducing a Vcs will slow you down at first but it will be very helpful in managing your project. If I got you right, so far you have been developing directly on the production server accessing the code through FTP, this is fast of course but also very much error prone; also you can not work in parallel with other developers (what if two of you want to edit the same file?).

  2. Usually you recreate the production environment (almost) on every developer's machine, it can be a "lightwaighted" version of it but you'll need it for debugging. This is regardless of Git or whatever Vcs you want to use.

  3. I fear this is a bad programming habit, your application shouldn't hard-code any domain and internal URLs should always be relative.

  4. You should definitely find a way to script database migrations, the project should be reproducible on a different machine.

From your question tough I think you need a framework more than a Vcs. Have you ever considered learning Django, Ruby on Rails, CakePHP or something the like? They would answer all your doubts in one solution.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for your answer! You're right about #3 for sure. A lot of systems actually store the URL in the database but I guess if you're running a local copy then it could be different there. Edit: Yes, I am actually familiar with all of those frameworks, but I've never used one with a VCS. CakePHP was great a few years ago, now days all the talk is Laravel.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.