Jenkins

No such DSL method 'pipeline' found among steps

不羁岁月 提交于 2021-02-08 14:59:57
问题 I keep getting this error for the declarative pipeline script in Jenkins. No such DSL method 'pipeline' found among steps My script is like this pipeline { agent any stages { stage('Example Build') { steps { echo 'Hello World' } } } } I have Jenkins version 2.19.4. Hopefully i have installed all the required plugins. Why do i get this exception ? 回答1: I think you have installed the latest plugins, 1.2. I had the same issue that after I upgraded the Pipeline: Model Definition to 1.2 my

Jenkins:How to Achieve parallel dynamic stages in jenkins declarative pipeline

ぐ巨炮叔叔 提交于 2021-02-08 11:03:53
问题 I am working on declarative pipeline. I am trying to achieve dynamic stages which should distribute the stages parallel with the agents defined. When i explored i learned how to achieve Dynamic sequential stages. Below is my sample code. My problem now is, how to achieve parallel stages with agents i have. For example, if i have 3 agents all the 5 stages should run parallel in the agents parallel. I tried using parallel tests but not working. Please help me to improve further ! def learn

Problem in building a docker image with pyspark lib

笑着哭i 提交于 2021-02-08 11:00:57
问题 I'm trying to build a docker image using s2i and Jenkins. I have the following dependencies in the requirement.txt file scikit-learn==0.21.2 scipy==0.18.1 pandas==0.24.2 seldon-core==0.3.0 pypandoc pyspark==2.4.1 But my build process fails when it tries to install pyspark with the following error message Downloading https://repo.company.com/repository/pypi-all/packages/f2/64/a1df4440483df47381bbbf6a03119ef66515cf2e1a766d9369811575454b/pyspark-2.4.1.tar.gz (215.7MB) Complete output from

How to launch chrome browser from Jenkins directly instead of using code in eclipse

痴心易碎 提交于 2021-02-08 09:22:38
问题 I have created a maven project for Web automation tests I am using code below to launch browser System.setProperty("webdriver.chrome.driver", "pathChromeDriver"); driver = new ChromeDriver(); driver.manage().window().maximize(); Also I am using Jenkins to execute my test suite and it's working fine. Now I want to configure browser launch operation from Jenkins without using it in my maven project. Can we do this using plugins available in Jenkins ??? If yes then please help me with that. 回答1:

How to launch chrome browser from Jenkins directly instead of using code in eclipse

南楼画角 提交于 2021-02-08 09:22:32
问题 I have created a maven project for Web automation tests I am using code below to launch browser System.setProperty("webdriver.chrome.driver", "pathChromeDriver"); driver = new ChromeDriver(); driver.manage().window().maximize(); Also I am using Jenkins to execute my test suite and it's working fine. Now I want to configure browser launch operation from Jenkins without using it in my maven project. Can we do this using plugins available in Jenkins ??? If yes then please help me with that. 回答1:

Dynamic variable in Jenkins pipeline with groovy method variable

♀尐吖头ヾ 提交于 2021-02-08 08:01:34
问题 I have a Jenkinsfile in Groovy for a declarative pipeline and two created Jenkins variables with names OCP_TOKEN_VALUE_ONE and OCP_TOKEN_VALUE_TWO and the corresponding values. The problem comes when I try to pass a method variable and use it in an sh command. I have the next code: private def deployToOpenShift(projectProps, environment, openshiftNamespaceGroupToken) { sh """/opt/ose/oc login ${OCP_URL} --token=${openshiftNamespaceGroupToken} --namespace=${projectProps.namespace}-$

jenkins pipeline def new string parameter

◇◆丶佛笑我妖孽 提交于 2021-02-08 07:27:31
问题 I have a parameterized job with pipeline. for example: Predefined String Parameter: IP I'm trying to define a new String in the pipeline in order to use it as a new parameter when I'm calling to another "build job" I have tried the following method: import hudson.model.* node('master'){ if(ipaddr =='192.168.1.1'){ def parameter = new StringParameterValue("subnet", '255.255.255.0') //not working echo parameter //not working } stage ('Stage A'){ build job: 'jobA', parameters: [ [$class:

SSH - Help understanding proxy command

a 夏天 提交于 2021-02-08 06:47:49
问题 I am trying to debug a Jenkins Plugin that seems to be failing due to an SSH permission problem. Basically the plugin allows me to SSH from a master machine into a specific Jenkins build on the slave machine, but for some reason it fails on the system that I'm trying to use it on. When executed, the plugin tells me that I can use something like the following command to SSH into the slave build from the master machine: ssh.config Host=*.localhost Port=43689 ProxyCommand=ssh -p 43689 localhost

unittest, works locally, but not on a remote server, no module named x.__main__; 'x' is a package and cannot be directly executed

↘锁芯ラ 提交于 2021-02-08 05:58:40
问题 I am working on a Jenkins CI/CD pipeline for my Python package. My project file hierarchy is as follows: project/ - package_name - file1.py - file2.py - etc... - tests - unit - __main__.py - __init__.py - test1.py - test2.py All unit tests (I am using unittest ) are run using a single command python -m tests.unit via adding __init__.py of the following content: contents import os os.chdir(os.path.dirname(os.path.abspath(__file__))) and __main__.py which looks like this contents import

What if I want to use files in gitignore

ε祈祈猫儿з 提交于 2021-02-08 05:45:43
问题 For sensitive data such as aws keys or password, I put them to files which is in .gitignore to make sure it is not committed to git. However, when keys are going to be used when scripts are running, what should I do? Manually add key content in a file before running? What if the program need to be triggered periodically by Jenkins? Can anyone help me with this? 回答1: Manually add key content in a file before running? That is the general idea: sensitive information should not be in a Git repo,