Вопрос

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

Другие советы

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/

Лицензировано под: CC-BY-SA с атрибуция
scroll top