Jenkins

How to dynamically add all methods of a class into another class

僤鯓⒐⒋嵵緔 提交于 2021-01-28 14:22:51
问题 I have a global shared library on Jenkins implicitly loaded on all pipelines, then my Jenkinsfile is like that: new com.company.Pipeline()() And then the shared library has on directory src/com/company some files, below the Pipeline.groovy class: package com.company import static Utils.* def call() { // some stuff here... } The problem is, this way I have to static declare all methods, thus I lose the context and cannot access jenkins' methods easly without the Pipeline class' instance. As

Jenkins maven release job to trigger downstream parameterized job

时光怂恿深爱的人放手 提交于 2021-01-28 14:07:58
问题 I'm using the jenkins maven-release plugin to tag, package and perform a release. This is working fine. The plugin asks for: the version of the release (parameter releaseVersion of the release plugin); the version of development, after the release (parameter developmentVersion of the release plugin); Now, I want to have a second step after packaging this release. I want to import the specific version packaged (say 0.0.5) to our deployment tool. I did this by configuring a second Jenkins jobs.

org.openqa.selenium.os.UnixProcess checkForError - Selenium doesn't work over jenkins (openshift linux - chrome slave)

情到浓时终转凉″ 提交于 2021-01-28 13:00:40
问题 Selenium code works my local. However it doesn't work over jenkins because of server connection error regarding to jenkins console output. Jenkins has openshift structure and chrome slave. I've set the configuration that selenium would work on chrome node. I've also written the selenium codes as bdd (cucumber). This is how webDriver is initialized: ChromeOptions options = new ChromeOptions(); System.setProperty("webdriver.chrome.driver","/usr/bin/google-chrome"); options.addArguments("-

How to run jenkins build alternatively on slave nodes?

£可爱£侵袭症+ 提交于 2021-01-28 12:20:55
问题 Let's say I have a job A and also a slave configured. I want to run build 1 of Job A on master and build 2 of Job A on slave node. Is there an option to achieve that ? OR Is there a way where my job looks at master and if it already finds a build running, then start the next build on slave ? 回答1: Are you intending to run in parallel or just alternate? (Not a good idea to run jobs on master; could configure a node to run on same host as "master".). Seems to be parallel and you have restricted

Generate report and integrate it with jenkins

时光毁灭记忆、已成空白 提交于 2021-01-28 12:15:42
问题 I am new in Karate but know almost all the basics. I want to generate a report for my test cases which will be kept in the folder for history purposes. currently, I am using the HTML report which overrides or updates every time I run my test cases. If you can recommend me a step-by-step tutorial or a link, or simply give me a hint on how to approach this. I have tried to use the allure framework and I am struggling to set it up. Thought it would be the best approach to solve my problem.

Selenium Not able to run Firefox browser from Jenkins

*爱你&永不变心* 提交于 2021-01-28 12:05:10
问题 I tried running Automated test using selenium on firefox through jenkins on Ubuntu Machine but not able to run it. But the same code is running without failure using Eclipse. I am running it as maven project. Getting following error- "[INFO] Running TestSuite 1524549883598 geckodriver INFO geckodriver 0.20.0 1524549883615 geckodriver INFO Listening on 127.0.0.1:14395 1524549883939 mozrunner::runner INFO Running command: "/usr/lib/firefox/firefox" "-marionette" "-profile" "/tmp/rust_mozprofile

How to access to a static file in resources folder of the shared library from within a class in src directory

落爺英雄遲暮 提交于 2021-01-28 11:59:23
问题 I have the Jenkins shared library with the following structure: resources |-> config.yaml |-> projects.yaml src |_ com |_ rathath |_ jenkins |-> Configuration.groovy In src/com/rathath/jenkins/Configuration.groovy , I want to read YAML files in resources directory. I tried : @Grab('org.yaml:snakeyaml:1.17') import org.yaml.snakeyaml.Yaml import hudson.FilePath // ... def readConfig() { def config = [:] def cwd = hudson.model.Executor.currentExecutor().getCurrentWorkspace().absolutize() new

Authentication Error in Jenkins Send Mail

◇◆丶佛笑我妖孽 提交于 2021-01-28 11:56:31
问题 SMTP server [myserverName] Default user e-mail suffix [myemailId] Use SMTP Authentication true User Name [myemailId] Password [mypassword] Use SSL false SMTP Port 25 Reply-To Address [myemailId] Test configuration by sending test e-mail [myemailId] I am using above configuration for sending mails using java and Jenkins version 1.579, mail sent successfully using java but following exception came when tried to sent mail using Jenkins. I have also created credentials in Jenkins, can you please

Jenkins failure Java 12 OpenJDK - The JAVA_HOME environment variable is not defined correctly

試著忘記壹切 提交于 2021-01-28 11:41:49
问题 Configuring Jenkins (2.121.3) to use JDK 12 in the Global Tool Configuration->JDK installations... menu using "Download URL for binary archive" produces the following error when performing a build: The JAVA_HOME environment variable is not defined correctly This environment variable is needed to run this program NB: JAVA_HOME should point to a JDK not a JRE Build step 'Invoke top-level Maven targets' marked build as failure Finished: FAILURE How can I resolve this issue? 回答1: The tar file has

Has the TFS plugin for Jenkins been removed?

折月煮酒 提交于 2021-01-28 11:26:51
问题 I have been using Jenkins with the TFS plugin for several years but after installing Jenkins on a new machine, it seems that the TFS plugin cannot be found in the update center. All the other plugins that I could search for seem to work but not TFS, as if it had been deleted from there. I have tried using both jenkins-lts and jenkins weekly on two separate machines (both macs). This is the plugin I am talking about: https://github.com/jenkinsci/tfs-plugin The old wiki page for it also seems