Jenkins ~ Cluster distribution function and responsibility handling, jenkins Cluster
During automatic deployment of jenkins multi-node clusters, you can deploy them separately based on their project types, which can achieve load balancing and clarify their responsibilities, for example, for a java project, you can use the linux service for deployment (pull code, restore, compile, publish, generate an image, push the image to the repository, and create a service. net project you can use a windows server to implement jenkins nodes, and their portals are jenkins master nodes, which are distributed according to the labels of each node! Each node is responsible for restoring the project dependency package, compiling, releasing code, generating images, pushing images to the repository, and establishing the docker service, next, let's take a look at the details of these jobs, such as those on the windows platform.. net project, which has a windows server providing it with automated deployment services, using the following features.
The code for the above steps is as follows. The SH script is mainly deployed in linux. If it is deployed on windows, it is recommended to use the powershell script.
Project compilation and release
Set-ex export Publish_Path = "obj \ Docker \ publish" echo "project recovery" dotnet restore echo "project compilation" dotnet build echo "project release" dotnet publish-o obj/Docker/ publish echo "published successfully, start building a docker image"
Generate images and push them to the repository
#!/bin/shset -exexport IMAGE_NAME=microserviceOrderexport Registry_Url="www.lind.cn:8443"docker build --no-cache --pull -t $IMAGE_NAME ./docker tag $IMAGE_NAME $Registry_Url/$IMAGE_NAMEdocker push $Registry_Url/$IMAGE_NAME
Distribution and jenkins project dependencies can be specified when a node is created. After a request is sent to the master jenkins node, the tag is distributed to find the target node, then, process the relevant work, and implement automatic deployment of multi-objective association based on the dependencies of the constructed project.
The above content is my understanding of the responsibilities, request distribution, and project dependencies of each node in the jenkins cluster. I hope this will help you who are learning!
Thank you for your support!
Thank you!