In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article introduces the relevant knowledge of "Jenkins+Gitee how to realize CI/CD automatic construction of. NET microservice architecture". In the operation process of actual cases, many people will encounter such difficulties. Next, let Xiaobian lead you to learn how to deal with these situations! I hope you can read carefully and learn something!
CI/CD
It means continuous integration/continuous deployment, which is not a new concept either. The way to speak is simple: if you successfully build a CI/CD environment, when you need to iterate online programs, just submit code through git, and nothing else. Isn't that great? This gives you the ability to iterate quickly, which is also necessary in a microservices environment.
preparations
1. Prepare a. NET6 project:
Prepare a gitee warehouse
3. Prepare a server (not necessary)
install Jenkins
First run this code in docker (code from official website):
docker run \ -u root \ --rm \ -d \ -p 8080:8080 \ -p 50000:50000 \ -v jenkins-data:/var/jenkins_home \ -v /var/run/docker.sock:/var/run/docker.sock \ jenkinsci/blueocean
It doesn't matter if you don't download the image in advance, because it downloads automatically. As follows:
The container is running, visit 8080:
The first time jenkins starts, it goes into the installation wizard and automatically generates an administrator account, but the password is printed into the log. Because I started it via docker, to view the container log, the statement:
docker logs [container id/name]
The password is between two asterisks:
Paste to the previous page and click OK to enter the next page:
The page gives two options for plug-in installation: recommended installation, custom installation, and any one you choose.
After installation, enter the account settings page:
You can skip and continue to use admin account, or you can customize one. It is recommended to customize one that is easy to remember.
Finally, you can set the address to finish the installation wizard:
Add and configure Gitee
Jenkins does not support gitee by default, you need to download a gitee plugin to be able to find the plugin management search gitee and download:
Then go to system settings and configure gitee:
Notice the certificate here. Click Add and select "Gitee API token":
APIV5 token here, log in to gitee account, set → private token, generate a new one.
After adding, select Certificate and click Test:
When you see success, save exit.
new workflow
Next, create a new "Freestyle" task.
On the Source Control page, select Git and enter the address of your repository:
It is normal to report errors here, because there is no configured account password. Click Add a Certificate, select Account Password for Type, and select it. Normally it looks like this:
Then set the branch below, which determines which branch of code jenkins pulls (or any branch if not written):
Then it is to build a trigger, select push code to gitee trigger (copy this url first):
After checking, there will be a lot of options, the rest do not have to worry about, just need to generate a token here can:
Then go back to gitee repository, find admin →webhooks→ new, fill in the prepared address and token:
After adding successfully, look at the result of the test request. Under normal circumstances, it is 200:
Next, test whether the trigger works properly. Pre-build workspace is empty:
After manual build:
Now submit the modified code to gitee and see if it builds automatically. I just used the VS tools to submit:
Then go to the jenkins background and you can see that there is one more build record:
Poke in to see the console output:
It was indeed the modification I submitted just now, and the automatic construction succeeded.
"Jenkins+Gitee how to achieve. NET microservices architecture CI/CD automatic construction" content introduced here, thank you for reading. If you want to know more about industry-related knowledge, you can pay attention to the website. Xiaobian will output more high-quality practical articles for everyone!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.