Jenkins

Can jenkins hide its “execute shell” command when running a job?

人走茶凉 提交于 2021-02-20 18:54:11
问题 For Example if I put bash abc.sh in the "execute shell", The job output will be: + bash abc.sh the output of the script But what I want is only the output of this script, is there anything i can do to hide the + bash abc.sh ? Thanks in advance. 回答1: It seems i find the answer.... set +x <command> set -x This solves my problem. 来源: https://stackoverflow.com/questions/46420241/can-jenkins-hide-its-execute-shell-command-when-running-a-job

How to require two or more labels for a jenkins job?

本小妞迷上赌 提交于 2021-02-20 18:53:45
问题 I don't know how it happens that the option named "Restrict where this project can be run" from Jenkins seems to allow only a single value inside "Label Expression" field. I tried lots of combinations in order to add more than one label and I wasn't able to find any way to put two. I need to mention that I need AND between these labels. The irony is that this option even has an Info button which loads some documentations, which is missing to say how an expression is supposed to look like.

Export variables from Octopus project to json file

主宰稳场 提交于 2021-02-19 08:24:05
问题 Is there any way to export Octopus variables to json file, using "Command" step in Jenkins? According to official Octopus documentation I only able to export Projects and Releases. Is there any way to export particular variables from particular project? 回答1: Currently you can not do this using Octo.exe. However you can still use Octopus REST API for your purpose. First you have to create a API Key, which is required to access those APIs. Then call following API end point to get your specific

How to create/recommend ClearCase baseline via commands?

我只是一个虾纸丫 提交于 2021-02-19 07:45:21
问题 Jenkins allows to add a build step that executes Windows Batch Commands. What would be the commands to create and recommend a ClearCase baseline? The stream has only one component. The baseline should take all activities, so no activity selection. Commands cleartool mkbl -view myViewName "Test" // created baseline Test.150 回答1: If you can execute cleartool command, you would recommend a baseline using cleartool chstream: cleartool chstream -nc -recommend BL1@/vobs/pop_pvob Rules for

Selenium test works in local machine, but fails on Jenkins

こ雲淡風輕ζ 提交于 2021-02-19 06:12:24
问题 My test works just fine on my machine. However, on Jenkins, I have the following error: Traceback (most recent call last): File "/var/lib/jenkins/jobs/twist-press-ricardo-fork/workspace/.env/local/lib/python2.7/site-packages/django/test/utils.py", line 216, in inner return test_func(*args, **kwargs) File "/var/lib/jenkins/jobs/twist-press-ricardo-fork/workspace/twist/tests/interface/test_hello.py", line 42, in test_login open_login_modal_btn.click() File "/var/lib/jenkins/jobs/twist-press

Selenium test works in local machine, but fails on Jenkins

こ雲淡風輕ζ 提交于 2021-02-19 06:10:43
问题 My test works just fine on my machine. However, on Jenkins, I have the following error: Traceback (most recent call last): File "/var/lib/jenkins/jobs/twist-press-ricardo-fork/workspace/.env/local/lib/python2.7/site-packages/django/test/utils.py", line 216, in inner return test_func(*args, **kwargs) File "/var/lib/jenkins/jobs/twist-press-ricardo-fork/workspace/twist/tests/interface/test_hello.py", line 42, in test_login open_login_modal_btn.click() File "/var/lib/jenkins/jobs/twist-press

Triggering jenkins build over ssh?

倾然丶 夕夏残阳落幕 提交于 2021-02-19 04:50:26
问题 I'm trying to trigger a Jenkins build from a USS (unix on z/os) git repository. The jenkins server is running in tomcat on my local windows machine. Most examples on the web describe a solution like this: http://www.andyfrench.info/2015/03/automatically-triggering-jenkins-build.html and I managed to get that working on my home pc from a local windows-based git repo to my locally running jenkins server. Basically, this involves creating a post-commit hook and invoking a special Jenkins git

Jenkins Pipeline does not run with docker-compose because it cant connect to docker daemon

别来无恙 提交于 2021-02-19 03:19:36
问题 I am trying to build an docker image and start the container with docker-compose inside a Jenkins pipeline. I have a custom docker image for my Jenkins where I use the Jenkins out of the box image and install Docker CE and docker compose. The Dockerfile: FROM jenkins/jenkins:2.159 USER root # create dir to save jenkins log files RUN mkdir /var/log/jenkins RUN chown -R jenkins:jenkins /var/log/jenkins #############################################################################################

Restarting Tomcat after a successful deployment with Jenkins

馋奶兔 提交于 2021-02-18 22:26:11
问题 How can I have Jenkins restart a Tomcat instance after a successful deployment? I already tried using a batch script, but the Tomcat instance is killed when the build is finished. 回答1: Your answer lies in Jenkins ProcessTreeKiller. A more detailed explanation here. It's a design decision to kill any processes that are spawned by the build to maintain a clean environment. Unfortunately that means you can't leave a process (such as Tomcat) running after the build. You can disable this

How to use Jenkins pipeline `options` correctly

霸气de小男生 提交于 2021-02-18 21:12:09
问题 Snippet generator created a properties block for me. First run reported WorkflowScript: 1: The properties section has been renamed as of version 0.8. Use options instead. @ line 1, column 1. pipeline { Replacing properties to options results with the following error: Errors encountered validating Jenkinsfile: WorkflowScript: 4: options can not be empty @ line 4, column 5. options([$class: 'ThrottleJobProperty', Here is the full jenkinsfile for reference pipeline { agent any options([[$class: