Jenkins – Kubeconfig

  To store and switch between Kubernetes configurations, you can use the Kubernetes CLI plugin, to work with it, "kubectl" must be installed in the system Install the plugin Go to "Manage Jenkins"   Section "Manage Plugins"   Go to the "Available" tab and in the search indicate "Kubernetes CLI" Install it.   Add Kubernetes … Continue reading "Jenkins – Kubeconfig"

Jenkins – Active Choice: CheckBox – Default values

  When working with the Active Choice CheckBox parameter, you can select the default values by adding the ": selected" parameter Pipeline:   When assembling with parameters, two environments at once, "Development" and "Production" will be selected by default

Jenkins – Active Choice: Pipeline examples

  A few examples of how Active Choices parameters in Pipeline as a code Example 1 Single selection from the list provided. A drop-down list of environments, by default, the first item in the list is selected. Pipeline:  

Jenkins – Username

In order to find out Jenkins username, you need a plugin user build vars Go to Jenkins settings   Section "Manage Plugins"   Go to the "Available" tab and specify "user build vars" in the search. Install it.   An example of using a plugin from Pipeline:   The module also has the following variables: … Continue reading "Jenkins – Username"

Jenkins – Checking if a string value is set to a parameter

  Check if the value of the variable "GIT_COMMIT_ID" is set, if so, then do a checkout by the hash of the commit, if not, then do a checkout by the name of the branch. The variable "GIT_BRANCH_NAME" is taken from the Active Choice parameter. Jenkinsfile: