2

We are 4 developers working on a PHP-mySQL web project. Currently we work together as described below: All project files except DB is hosted at GitHub

  • All project files except DB is hosted at GitHub
  • DB is on our production server
  • We have local web server and php installed and working locally, connection to DB is remote. So database is in sync always.
  • Each developer pulls from GitHub, then pushes his changes to GitHub
  • Server pulls from GitHub to update the website

The problems we've faced so far is

  • Pulling from GitHub on the server is either manual or done by cron job. Which I don't feel it's the right choice.
  • Because our local machines use remote mySQL connection, we encounter time outs in executing queries.

So I don't know what would be a better approach for our situation?

1
  1. For website updates, you can set up a WebHook (Github -> Repository-Settings -> Webhooks). It can call a custom URL when a push to the repository has happened.

  2. There's something wrong with either your application, your internet connection or MySQL Server. Your setup with a remote database is not uncommon, actually it should be able to maintain a stable connection.

-- Else: like @Evgeny said, you could use a CI Server (Jenkins, TeamCity, etc…) but it really depends on the complexity of your project. Because it's not a "no brainer" to setup such a pipeline with continuous integration.

1

I think, the first - you must use some of continuous integration tools. The best of all I know is Jenkins. I think you have to make some research on this. This is not so difficult, but very useful. Next I think that you must think about similar development environment. Docker help you with this.

Here is a link for Docker:https://docs.docker.com/get-started/ Here is a link for Jenkins: https://jenkins.io/doc/

  • 1
    Evgeny -- welcome to Programmers. This has the beginnings of a good answer. Could you fix the spelling (continuous) as this will help other people find this answer with a search engine. Also, it would be helpful to provide links to Jenkins and Docker. Please refer to this guide on writing answers on stackexchange. – Jay Elston Dec 22 '15 at 18:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.