For a parameterized assembly with an image tag selection, you will need the Active Choices plugin Go to "Manage Jenkins" Section "Manage Plugins" Go to the "Available" tab and select "Active Choices" in the search. Install it. Create a "New Item" – "Pipeline", indicate that it will be a parameterized assembly, and …
Continue reading "Jenkins – Active Choice: AWS ECR Images tag (AWS Cli)"
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"
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"
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
When working with the Active Choice CheckBox parameter, the parameter values are written to the variable, separated by commas. To work with them as separate elements, you need to save them in an array. For example, there is the following Active Choice, which displays a list of environments in the form of a CheckBox. Pipeline: …
Continue reading "Jenkins – Active Choice: CheckBox – Working with an Array"
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:
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"
For a parameterized build with branch selection, you will need a plugin Active Choices Go to Jenkins settings Section "Manage Plugins" Go to the "Available" tab and specify "Active Choice" in the search. Install it. Create a "New Item" – "Pipeline", indicate that it will be a parameterized project, and add the …
Continue reading "Jenkins – Active Choice: Git branch"
By default, Jenkins uses your browser’s settings language. In order to force change it, you can use the Locale plugin Go to Jenkins settings Section "Manage Plugins" Go to the "Available" tab and specify "Locale" in the search. Install it. And back to Jenkins settings, tab "Configure System" Find the …
Continue reading "Jenkins – Change default language"
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: