Jenkins – Add new path to PATH

  To add the path to the Jenkins environment globally, without doing this every time in Pipeline, we’ll go to the Jenkins settings   Next is the tab “Configure System”   Find the “Global properties” block, check the “Environment variables” checkbox. And we add a variable with the name “PATH + EXTRA” and the value … Continue reading "Jenkins – Add new path to PATH"

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:

CentOS 7 – Jenkins install

Install Java OpenJDK, as it is a dependency for Jenkins. The latest versions of Jenkins are compatible with version 11, so let’s install it.   To add the Jenkins repository, you will need the “wget” utility, if it is not installed, then install:   Add the repository and import its key:   Install Jenkins:   … Continue reading "CentOS 7 – Jenkins install"