Questions tagged [jenkins]

Jenkins is an open source continuous integration server

Filter by
Sorted by
Tagged with
0
votes
0answers
31 views

How to pass username and password of a bitbucket repository to a shell script triggered via jenkins

I am trying to create a Jenkins job that will trigger a shell script via the option Send files or execute commands over SSH in Jenkins. The following is the main part of my shell script: #!/bin/bash ...
0
votes
2answers
17 views

How to define the 'From' field for email notification in one command from execute shell

I have Jenkins pipeline (illinXXX) with execute shell, which part of it runs the below command: echo "LDAP server is down"|/usr/sbin/sendmail -t arielma@gmail.com Any idea how can I change the 'From'...
0
votes
0answers
25 views

Find out which user is running a job in Centos

I have Jenkins configured in a Centos server and there are lots of jobs running. Various jobs have various triggers. Recently, some job wiped out the entire contents of one of my directories. Since ...
0
votes
0answers
18 views

shell script IF multiple condition error with AND operator [duplicate]

cat test.sh if [ "4" == "4" ] && [ "3" == "3" ] then echo "pass" else echo "fail" fi sh test.sh test.sh: 1: [: 4: unexpected operator fail NOTE: The above code works with Bash shell. I ...
0
votes
1answer
35 views

How to set and record alerts for Jenkin server down and up

I have Jenkins pipeline job which goes thought all our Jenkins servers and check the connectivity (runs every few minutes). ksh file: #!/bin/ksh JENKINS_URL=$1 curl --connect-timeout 10 "$...
0
votes
1answer
393 views

Unit jenkins.service could not be found

I am trying to start Jenkins in a Centos 7 machine. I am trying to copy the Jenkins folder from another machine to this machine and start it here instead of downloading. I copy the entire Jenkins ...
0
votes
1answer
29 views

Can I migrate Jenkins from Centos machine to another just by copying the Jenkins folder

I am trying to copy my Jenkins from 1 Centos machine to another. I am trying to Zip the entire Jenkins folder and Unzip it in the another machine. When I try to start Jenkins in the new machine, I ...
0
votes
0answers
10 views

Jenkins program sleeps after inactivity

I have jenkins running on Debian and I have the ports forwarded correctly. I can access it from other networks just fine after I start jenkins running. But after 5 minutes of not interacting with ...
0
votes
1answer
21 views

Getting below error while building an image in docker

Getting below error while building an image in docker: docker build -t demo . Output : Sending build context to Docker daemon 2.048kB Step 1/3 : From tomcat:8 ---> 8973f493aa0a Step 2/3 : ...
3
votes
1answer
3k views

How to save command result in variable in Jenkins shell build step

I want to run this script inside my Jenkins job. My goal is to save the cat output into a variable so that I can use it somewhere else. #!/bin/bash ssh myserver.com <<EOF echo "Start." CYCLE=$...
0
votes
0answers
31 views

Jenkins - Bash if else statement variable not found [duplicate]

I am having a steps in Jenkins pipeline to read my test passing result and fail the Stage if rate lower than 95%. Here's the code sh ''' #!/bin/bash -xe PASS= `cat index.txt | grep % ...
0
votes
1answer
257 views

Jenkins port in RHEL Maipo is pointing to tcp6

I have installed jenkins packages and started the service. But i am not able to access the url. when i am checking the ports listening, i could see that the port for jenkins is with tcp6. How do i ...
0
votes
0answers
183 views

unable to access env.$variable in jenkins pipeline with groovy

i am writing a groovy based Jenkins pipeline , like this stage("checking if the branch exist in github for a repo"){ container('golang'){ def checkoutPath = new utils()....
3
votes
3answers
140 views

tail a log util keywords found or timeout

I'm using a special way that can let me visit google. It is very different in the page now... So I can edit the question and comment the answers normally. I deleted more early discussions and go to ...
0
votes
1answer
532 views

Broken pipe only in Jenkins

I have a script that works just fine locally. But when I run it in Jenkins, I get Error: writing output failed: Broken pipe. My question is how can I fix this to work in jenkins? Now for the context ...
0
votes
0answers
2k views

How to put secure password in Jenkins Groovy parameter script

My overall goal is to create a build parameter in Jenkins which is a drop down for only release branches. I have been at this for some time and know there are many ways to do this. Let me run through ...
0
votes
1answer
957 views

Jenkins how to catch error in script

What I am trying to do is once source .... command is executed if there is an error I want to put it into temp file. I tried several ways but no luck. def responseValue = sh(script: """#!/bin/...
0
votes
1answer
6k views

grep on a shell command in a pipeline scripted script

When I want to make several shell commands my scripted pipeline returns the answer of the first command without executing the pipes. Here is my case: I want to get specific content on an HTML page. So ...
1
vote
2answers
383 views

How do I run Jenkins with a specific working directory and a specific user account?

I am executing below jenkins.war with below command jenkins -jar jenkins.war But I want to specify to use below path while executing the war `/data/jenkins` and it should run as jenkins user . ...
0
votes
0answers
202 views

Jenkins Docker exec : No such file or Directory

I installed Jenkins using below command sudo docker run -u root -d -p 8081:8081 -p 50001:50001 -v /data/jenkins-data:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock ...
0
votes
1answer
6k views

Jenkins pipeline: scp tries to copy to other remote, Host key verification failed [duplicate]

I use Jenkins in ubuntu server. In this case, I want to copy a file to another remote server. I use SCP command inside sshagent the Jenkins pipeline. I tried the solution from unable to scp in ...
2
votes
1answer
932 views

find command fails in jenkins, but not in terminal

I want to export all frames from a lot of video files, automatically in a jenkins build job using ffmpeg. This script is running fine when I ssh into the slave and execute it in the same folder: ...
1
vote
1answer
29 views

How to know if Jenkins is patched on CentOS 7

I've been using rpm -q --changelog package_name to check if a certain cve vulnerability has been patched on my system. However, when I'm doing the same for jenkins, all I got was Sat Apr 19 ...
0
votes
1answer
103 views

Invoke UI from pseudo console

We have some UI test cases which we are currently invoking manually on our Linux machine (with Gnome enabled).  We login to the machine and run the below command: java -jar test_case.jar to invoke ...
0
votes
1answer
3k views

JSON on the command line with jq in Jenkins

I used jq -r '.version' package.json command to filter the version from package.json file using the terminal. Can we use jq command in Jenkins shell without locally installing it?
1
vote
1answer
1k views

jenkins can't recognise known_hosts file

I am using Centos 7. I have Jenkins installed on it I have copied ~/.ssh directory to /var/lib/jenkins/ Contents of .ssh directory are authorized_keys id_rsa id_rsa.pub known_hosts Now when I am ...
1
vote
0answers
110 views

Jenkins on solaris operating system

Need to install jenkins server on solaris box, this is the version details, can we get any jenkins package to install? Solaris details: Oracle Solaris 10 8/11 s10s_u10wos_17b SPARC
0
votes
1answer
3k views

can i safely remove /var/log/jenkins/jenkins.log (/var: 100% used) [duplicate]

I am running out of disk space with /var system file and noticed /var/log/jenkins/jenkins.log file is occupied 7 GB. Can i safely remove this log file ?
2
votes
1answer
5k views

Jenkins write permission on linux

I'm having trouble getting Jenkins to write to a directory, however I believe I have set the correct permissions. Jenkins is being run by a user named "jenkins", who belongs to a group called "jenkins-...
2
votes
1answer
731 views

Redirecting output to a file silently? [closed]

So I have this here: echo "$(some docker command that gives output)" > file When I run this from Jenkins, the command’s output is shown in the Jenkins log. I do not want this to happen. How can ...
0
votes
4answers
1k views

Disowning child from parent process

If $PID_PARENT launched $PID_CHILD, how can I detach (disown?) $PID_CHILD from $PID_PARENT so that, when I kill $PID_PARENT, $PID_CHILD keeps running like nothing happened? Concretely, my $PID_PARENT ...
1
vote
0answers
2k views

Unable to execute script on remote host using ssh-plugin - Jenkins

I am trying to test ssh-plugin on Jenkins to execute the shell script on the remote host. I have added the site and the connection is successful. However, when I tested this Execute shell script on ...
0
votes
1answer
140 views

jenkins behind nginx in kubernetes

I have a jenkins server behind a Kubernetes (AWS ELB - NGINX proxy ). When I try to trigger a remote job using curl it fails: # curl -X POST -H "$CRUMB" "https://jenkins:add91b3fefefefefef@jenkins....
1
vote
2answers
1k views

How to set ansible playbook to reboot servers

I want to be able to write one playbook to update all my servers in different environments - stage and prod. I do not want to reboot these servers every time there is an update to the kernel, I only ...
4
votes
1answer
4k views

Ansible - How to mark a tasks as success when it failed actually

We are using some pipelines to build servers using ansible and one of the task is to check if server is online (means a production server in inventory list by accident). We check the port 443 and ...
2
votes
2answers
3k views

how to disable the “CSRF protection ” in jenkins by default

I need to disable the CSRF protection in jenkins, which is enabled by default. The problem is after containerizing this, when ever i spun up a new container with jenkins inside it, it throws a "No ...
0
votes
2answers
44 views

Is it possible to download and configure jenkins with a script?

I want to develop a continuous integration with one or many scripts locally and then on a server. For that I need Jenkins. I installed jenkins in a docker container, but would it be possible to ...
-1
votes
1answer
386 views

Passwordless ssh does not work with multiple servers

I have a jenkins server that runs a job to ssh (passwordless) out to Server A and runs a script. This works very well and I set it up by doing: ssh-keygen -t rsa on Jenkins Copy over the id_rsa.pub ...
3
votes
3answers
39k views

Where should environment variables be set for Jenkins

I am using Jenkins to automate application builds using Maven on Linux. Where should I set environment variables such as $JAVA_HOME and append items to $PATH so that they are available to Jenkins? ...
0
votes
0answers
531 views

How to diagnose this Kubernetes pod high load

I am executing a Jenkins pod instance in IBM Cloud kubernetes service. I am getting a very high load even though none of the processes has high load. I have read that it has to do with IO requests. ...
0
votes
1answer
466 views

Unable to run Jenkins Slave jobs on AWS EC2 Centos 7 VM

I have Jenkins Master Server running on prem and my slaves are running on AWS. It's Centos 7 EC2 VM. When Jenkins tries to push slave.jar file over scp it fails with the following error message: ...
1
vote
1answer
500 views

jenkins job not waiting defined time

i have a jenkins job that is executing a shell, i want it to wait , if a particular condition is not as per desired state,, but the job executes with 22 sec, where as i have asked it to wait for 30 ...
0
votes
0answers
269 views

unable to load variable value in jenkins build

ok i have situation my in current jenkins build. Build steps are like this sh new_script.sh $USER helm package $USER container_name=`helm install $USER-0.1.0.tgz | grep ContainerCreating | awk '{...
1
vote
1answer
2k views

branch name in Jenkins regular pipeline job

For a Jenkins pipeline job having web-hook trigger in Git/Bitbucket, each repo push triggers pipeline job. How we can know branch name in pipeline job on which push/change is committed. I need this ...
1
vote
1answer
3k views

Connecting to a docker host!

Does any one how to connect to a docker host uri?? i need to setup jenkins to perform task on a docker host?? This is the docker host info. This is Ubuntu based machine. root@node1:~# netstat -tulnp |...
1
vote
1answer
980 views

Running a script through jenkins [closed]

I need to run a script through jenkins, the script is located, at a user x home directory, /home/x/script.sh This script should only run through user x only as it will pull config settings from ....
0
votes
0answers
110 views

Jenkins nginx config 'not secure' two subdomains

I am getting a not secure on the website and I can't figure out why, here's the nginx config; upstream jenkins-av-server { server jenkins.audience-view:8080 fail_timeout=0; } server { listen 80; ...
0
votes
0answers
248 views

Jenkins in Docker doesn't have access to /dev/vboxnetctl for VirtualBox

I'm trying to set up Jenkins (runs in Docker; official image) which runs as user "jenkins". And Jenkins should start a virtual machine using docker-machine and virtualbox. I bind-mounted /dev/...
0
votes
1answer
1k views

Trying to restrict Jenkins access to specified group in FreeIPA

========== IPA config ========== ========== Jenkins config ========== ========== Jenkins warning (user in "jenkins-usergroup") ========== ========== Jenkins warning (user not in "jenkins-usergroup")...
0
votes
1answer
877 views

Apache mod proxy does use a different charset then proxied server

I'm running jenkins, a java web application, on port 8080 behind an apache2 server using mod_proxy. +---------------+ +----------------+ | apache2 | -----> | jenkins:8080 ...