Jenkins automated deployment configuration

1. Jenkins plugin installation

  • ant
    insert image description here
  • Build Failure Analyzer
  • Build Monitor View
  • Build Timeout
    insert image description here
  • docker
  • Email Extension Plugin

insert image description here

  • gitee
  • github
  • gradle

insert image description here

  • java mail
    insert image description here
  • JDK Parameter Plugin

insert image description here

  • kubernetes
  • locale
  • chinese

insert image description here

  • Matrix Authorization Stratepy Plugin
  • maven

insert image description here

  • next BUild Number Plugin
  • OWASP Markup Formatter Plugin
  • Pam authentication Plugin
  • pipeline

insert image description here

  • Publish Over SSH
  • ReBuilder
  • Repository Connector
  • Role-based Authorization Strategy

insert image description here

  • sonar
    insert image description here
  • SSH Server
  • ThinBackup
  • Subversion Plug-in

insert image description here

  • WMI Windows Agents Plugin
  • Workspace Cleanup Plugin

insert image description here

2. Configuration

2.1 Global tool configuration

  1. maven
    insert image description here
    insert image description here

  2. git
    insert image description here

  3. docker
    insert image description here

2.2 Global configuration

2.2.1 gitee configuration

insert image description here
After the configuration is complete, click Apply and Save.

3. Create tasks

  1. new task

insert image description here
2. Build a Maven project
insert image description here

  1. Add the git warehouse address,
    insert image description here
    select https, and then enter your own gitee account password.
    If SSH is required, an SSH key needs to be configured.

add gitee ssh

Use the command to add in the linux system

git config --global user.name "AD_youyu"
git config --global user.email "YourEmail"

insert image description here

Add the key with the following command

ssh-keygen -t rsa -C "YourEmail"

# 密钥默认地址
/root/.ssh
# 私钥是id_rsa
# 公钥是id_rsa.pub
  • Copy the public key and add the public key to gitee

The link is as follows:
https://gitee.com/profile/sshkeys

  • Select SSH mode

insert image description here

  • Add your own username and private key

insert image description here
Passphrase is set by yourself, and the blogger directly sets it to empty.
Just save it.

  1. Click apply, save
  2. Click to build the project

Jenkins starts automatically at boot

# jenkins开机自启
systemctl enable jenkins
# 查看jenkins服务是否添加开机自启动
systemctl list-units | grep jenkins

Guess you like

Origin blog.csdn.net/dwh19992018/article/details/130280418