# 2020/09/17 #「Jenkins Pipeline」- Related plug-ins and programming practices

This part of the notes is organized: some plug-ins that will be used in Jenkins Pipeline are used for specific problems and specific scenarios in the Pipeline.

About the content of the notes

This part of the notes only organizes the content related to Jenkins Pipeline, and the content and programming implementation related to Apache Groovy will not be organized into this part. Explain as follows:

1) For connecting to the database, Jenkins Pipeline does not provide (mature and available) plug-ins or methods. We can only use Groovy to connect to the database.
This section will record the problems and solutions of Jenkins Pipeline connecting to the database, as well as simple examples, but Database connection and more code programming practices (such as specifying the connection to use UTF-8 encoding) will be organized into the Apache Groovy section. And this part will also record Groovy programming problems caused by the Jenkins Pipeline environment.

Basic plugin

The "basic plug-in" here refers to the plug-ins that must be installed, or extremely useful plug-ins, which may have been installed by default.

Pipeline Plugin

   
Plug-in function: -This is the basic plug-in of Pipeline. To use the Pipeline function, you need to install the plug-in, which allows you to coordinate simple or complex automation.
Plug-in address: https://plugins.jenkins.io/workflow-aggregator
Step manual: https://jenkins.io/doc/book/pipeline/
Other links: https://github.com/jenkinsci/pipeline-plugin

Pipeline Utility Steps

   
Plug-in function: -Provides a series of pipeline expansion steps. Such as YAML file processing
Plug-in address: https://plugins.jenkins.io/pipeline-utility-steps
Step manual: https://jenkins.io/doc/pipeline/steps/pipeline-utility-steps
Other links: https://github.com/jenkinsci/pipeline-plugin

File Operations Plugin

   
Plug-in function: -File and directory operation plugins, including copy, move, delete, etc. actions
Plug-in address: https://plugins.jenkins.io/file-operations
Step manual: https://jenkins.io/doc/pipeline/steps/file-operations/
Other links: https://github.com/jenkinsci/file-operations-plugin

Pipeline: Groovy

-Pipeline execution engine for CPS conversion based on Groovy script
https://wiki.jenkins.io/display/JENKINS/Pipeline+Groovy+Plugin
https://github.com/jenkinsci/workflow-cps-plugin

# TODO Groovy CPS
https://github.com/cloudbees/groovy-cps

Pipeline: Shared Groovy Libraries

https://plugins.jenkins.io/workflow-cps-global-lib
is a component of the Pipeline Plugin. Provides the ability to use shared libraries to extend Pipeline scripts.

Function plugin

"Functional plug-ins" here refer to plug-ins that implement certain functions, and are related to specific scenarios.

SSH Pipeline Steps

   
Plug-in function: -In Pipeline, use SSH commands to perform certain remote operations
Plug-in address: https://plugins.jenkins.io/ssh-steps
Step manual: https://jenkins.io/doc/pipeline/steps/ssh-steps/
Other links: SSH Steps for Jenkins Pipeline: https://jenkins.io/blog/2019/02/06/ssh-steps-for-jenkins-pipeline/

Kubernetes CLI Plugin

https://plugins.jenkins.io/kubernetes-cli
https://github.com/jenkinsci/kubernetes-cli-plugin

You can interact with the k8s cluster in Job, but the kubectl command needs to be installed in the system.

The function of this plug-in is to manage the credentials of the kubectl command, and the k8s cluster still needs to use the kubectl command.

The supported credential types are:

 

Token, as secrets (see Plain Credentials plugin)
Plain KubeConfig files (see Plain Credentials plugin)
Username and Password (see Credentials plugin)
Certificates (see Credentials plugin)
OpenShift OAuth tokens, as secrets (see Kubernetes Credentials plugin)

 

When adding a certificate in Jenkin, you can choose the "secret file" type, and then upload the $HOME/.kube/config file.

Last Changes

   
Plug-in function: -Output the content of this build change
Plug-in address: https://plugins.jenkins.io/last-changes
Step manual: https://jenkins.io/doc/pipeline/steps/last-changes/
Other links: https://github.com/jenkinsci/last-changes-plugin

instant-messaging

   
Plug-in function: -Provide general support for building notifications and bots. The plug-in itself is useless to users and you need to use derivative plug-ins, such as Jabber or IRC plug-ins!
Plug-in address: https://plugins.jenkins.io/instant-messaging
Step manual:  
Other links: https://github.com/jenkinsci/instant-messaging-plugin

IRC

   
Plug-in function: -Provide general support for building notifications and bots. The plug-in itself is useless to users and you need to use derivative plug-ins, such as Jabber or IRC plug-ins!
Plug-in address: https://plugins.jenkins.io/ircbot
Step manual: https://jenkins.io/doc/pipeline/steps/ircbot/
Other links: https://github.com/jenkinsci/ircbot-plugin

Jabber (XMPP) notifier and control

   
Plug-in function: -Provide support for XMPP notifications. ! ! ! Currently, it is not supported in PIPELINE because of WIP status.
Plug-in address: https://plugins.jenkins.io/jabber
Step manual:  
Other links: https://github.com/jenkinsci/jabber-plugin
  https://issues.jenkins-ci.org/browse/JENKINS-36826

Other content

Replace POST step in scripted PIPELINE

Post equivalent in scripted pipeline?
Use try...cache...finally statement to catch exceptions and simulate POST steps.

The problem with escaping quotes

Jenkinsfile idiosynchrasies with escaping and quotes

Jenkins Shared Library Test Harness Example

https://github.com/stchar/pipeline-sharedlib-testharness

Related Links

Pipeline Syntax reference
Pipeline Steps reference

Private Jenkins Shared Libraries
How-To Use third party libraries in Jenkins Pipeline

Jenkins CPS

What's meaning of CPS in jenkins. what's the full name of CPS?
GitHub/cloudbees/groovy-cps
Basics of Continuation Passing Style

references

K4NZ / related plug-ins and programming practice
Jenkins Plugins
Jenkins / Pipeline

Guess you like

Origin blog.csdn.net/u013670453/article/details/108680106