Before going into the pit dotnet core, because the web that was first encountered in compiling the publication on Windows could not be directly placed on the CentOS execution. After that, you will study Docker directly, enabling you to compile the publication in the container. Then the more you play, the more you use Git's hooks to automate the Git source code to automatically get new codes and compile the release as soon as you receive the push. Finally, in order to facilitate reuse, directly into the unified configuration, so there is no need to write a complex script configuration. Just open the configuration file, configure several values, and run a script to OK.
There are currently two versions, and the original version includes the automatic cloning of the Git project. The V1 version takes git clones out of the human cloning. See the Readme document for details.
Technology stack
- ASP. NET Core
- Shell Script
- Python
- Docker
- Docker-compose
- Nginx
GitHub Address: Https://github.com/CrystalWindSnake/NetCore.Test.AutoDeployment.git
The record of the pit s (which is slowly replenished here) after the source update, after restarting the Web container, there will be a 502 error accessing the webpage again.
The reason for this is because of the Docker network mechanism. Each time the container starts, Docker assigns an IP address to the container, and if there is network traffic between the configuration containers (via links), the IP information of the connection container is recorded in the hooks file in the container. However, because the Web container restarts without restarting Nginx, the Nginx container also records the IP information of the previous Web container, causing the update to revisit the Web container when it accesses Nginx again.
The workaround is to configure a separate network (via Docker-compose). See the following interception configuration (DOCKER-COMPOSE.YML)
Version: ' 3 ' Services: Web: Networks: -AUTO-CI-NW Nginx: Networks: -AUTO-CI-NW Networks: AUTO-CI-NW:
ASP. NET core combines Docker for source, deploy, update