I posted a new version of the project by clicking the "Publish" button (Web deploy). But the site refused to start with error 502 ... Now the site is not being visited and is under development, and I want to know for the future how you can instantly roll back to the working version (in this case, the previous one) to deal with the problem.

How can I roll back the publication version ??

How to test before final publication? It is necessary to create an additional server (for example, openwork, I checked, by the way, it works for openwork, unlike my server ...) or can I test it in the same place but in "developer mode"?

    1 answer 1

    Your question has two aspects and the answer will also consist of two parts.

    First, you should learn about versioning controls (git, mercurial, tfs ...). If you keep the source code under version control, you can always collect the source code at any desired point. Even if you just start learning the very basics of git (without branches), this will already be a significant step forward: the current version did not work - they returned to the previous commit, collected the publication - they posted it.

    Secondly, you need to understand that if "it works on my computer, but not in production", then you need to think about how to build / deploy the same configurations. Modern tools for this - dockers and other containers.

    Bonuses Additionally, the pyramid of testing will help. From unit tests to integration tests. Additional bonuses can be extracted from the means of continious integration (source code assembly and their automatic publication).

    • 2
      I would also add that having a build server and the ability to deploy it, it will be possible to build any version of your application from source and not only test it, but also deploy it. That is, they collected a new release, tested it, grabbed it, did not like it, rebuilt the old release (or took its previous build) and didn’t take the place of a new one, received a rollback to the previous version in a couple of mouse clicks. - tym32167