At the moment, the project has dev server and each developer has its own local environment close to the real one.

How does the deployment to the master server go to the server and git pull is not done?

  • jenkins for example. Himself go and do)) - Moonvvell

2 answers 2

You basically asked about the delivery of files to the server ( git pull can do just that). In the case of a simple web application, this is enough, provided that you have a snowflake server and you configure it with your hands anyway.

As soon as the application becomes a bit more complicated, simple file delivery becomes insufficient. In this case, it becomes profitable to automate the deployment, to use specialized tools and phoenix servers .

I tried to briefly write about different methods and their advantages and disadvantages, but I realized that there are too many of them and all the characteristics very much depend on the task.

So here's something like a small mental map. Perhaps you have not yet thought about some issues and have not considered any of the options. I hope it helps you to make a choice, or at least see more fully the task.

So, three main questions:

  1. What to do? What does the deployment generally consist of:

    • Deliver the updated application to the server. Ways:
      • git pull on the server. Badly scaled.
      • Upload files using rsync . It scales well.
      • Upload files via FTP, run with a USB flash drive to the server, send it with Russian Post. In general, different ways for fans to overcome difficulties.
      • Pack some package manager in a package, drop it into the repository. For a web application it can be too difficult and slow. But well, if you sell the application and have to distribute it somehow.
      • Pack in the image, deploy in a container. Similar to the last item.
    • Configure the application.
    • Install and configure third-party applications (dependencies).
    • Start and restart processes.
    • Raise the database.
    • Get any data you need to work.
    • (There may be a lot of different tasks.)
    • ...
  2. How to do? What tool to deploy the application:

    • Hands on the memory.
    • Write a script and run it.
    • Write a script for a configuration management system.
    • Spread the finished image
    • (too many ways)
  3. When to do? How to initiate the deployment of a new version:
    • Manually. The person responsible for the release runs the tool from the past item or presses a button on the integration server that uses this tool.
    • Automatically in response to changes in the version control system. The person responsible for the release commits to master or creates and pushes a new tag to the server. The server responds and uses the deployment tool.

    And so it is possible, but of course it is better to use some kind of Continuous Integration, for example, Jenkins or go . In its simplest form, you can configure it as a Continuous deployment .

    The principle of operation is approximately as follows.

    The CI configures git, polling time, server. And once every few minutes, the repository is polled for changes on some thread. And the changes poured on the test.

    • And is Teamcity from that opera? - Shadow33
    • one
      Yes, Teamcity is CI. I did not deal with it, but there are examples in nete with its use. On Habre article there is makedev.org/articles/ci.html - Kostiantyn Okhotnyk