Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How Docker builds Jenkins and automates packaging and deployment projects

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article will explain in detail how Docker builds Jenkins and automates packaging and deployment projects. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Installation and configuration of Jenkins

Installation in Docker environment

Download the Docker image of Jenkins:

Docker pull jenkins/jenkins:lts

Run Jenkins in the Docker container:

Docker run-p 8080 mydata/jenkins_home:/var/jenkins_home 8080-p 50000 root 5000-- name jenkins\-u root\-v / mydata/jenkins_home:/var/jenkins_home\-d jenkins/jenkins:lts

Access jks directly through the virtual machine ip+ port. For the first access, you need to enter a password to read directly from the log.

Docker logs jenkins

Through the system management of global settings, the need to set up the jdk git mvn environment is important!

The first is an alias, which can be taken at will, and the second configuration environment variable mvn git is the same.

Enter the system configuration after configuring the global variables

Ssh connection

A successful point test indicates that the remote connection is successful.

Now that the basic configuration is complete, create a new workbench configuration project to package and deploy

1. Configure project road strength

two。 Configure mvn

3. Configure remote server road strength and scripts

Note that Source files must write the road strength of jks default packaging project.

Deploy the project shell script

Ps-ef | grep "port=9090" | awk {'print $2'} | xargs kill-9nohup java-Dspring.application.name=RuoYi-Dspring.profiles.active=druid-Dserver.port=9090-jar-Xms1024m-Xmx1536m-XX:PermSize=1024M-XX:MaxPermSize=1536M ruoyi-admin.jar & tail-f nohup.out

Click save to build the test directly

This is the end of this article on "how Docker builds Jenkins and automates packaging and deployment projects". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report