Linked Questions
39 questions linked to/from How to set environment variables in Jenkins?
64 votes
18 answers
171k views
How to get the BUILD_USER in Jenkins when job triggered by timer?
I wanted to show the user who triggered a Jenkins job in the post job email. This is possible by using the plugin Build User Vars Plugin and the env variable BUILD_USER. But this variable do not get ...
53 votes
3 answers
108k views
Passing variable from shell script to jenkins
I trigger a shell script from Jenkins, This scripts get date and export it as a environment(Linux) variable $DATE. I need to use this $DATE inside same Jenkins job. I made job as parameter build. ...
11 votes
4 answers
37k views
How do I set a Jenkins environment variable based on a job parameter?
I have a project where I need to set an environment variable based on a choice parameter the user chooses. Each project has a theme project dependency. I'd like to have the user choose the project and ...
15 votes
2 answers
68k views
How to set an environment variable programmatically in Jenkins/Hudson?
I have two scripts in the pre-build step in a Jenkins job, the first one a perl script, the second a system groovy script using the groovy plugin. I need information from the first perl script in my ...
10 votes
6 answers
22k views
use git repo name as ENV variable in jenkins job
I am trying to figure out a way to get the remote git project name in a jenkins job as a env variable. I would like to use the project name as the "local subdirectory name" when jenkins clones the ...
6 votes
1 answer
11k views
Using Slack to start Jenkins builds
we're about to wipe our Mac Mini and reinstall new XCode and Jenkins from scratch. We have just recently started using Slack and we would like to use it to receive Jenkins build notifications and to ...
1 vote
1 answer
8k views
Set Jenkins Environment variables via Groovy script
I'd like to set Jenkins Global Properties - Environment variables via Groovy script (YAML file) which is executed in Ansible. I've tried following import jenkins.* import jenkins.model.* import ...
4 votes
4 answers
6k views
variable set in Windows Powershell of Jenkins build, not available in other build steps
I have a Jenkins build with one parameter called VERSION. Based on the length of the variable i am modifying its value in Windows Powershell and then in the next build step, i want to use it. But ...
2 votes
2 answers
4k views
How programmatically to get Jenkins user id?
I would like to pass the user id of the person who started a Jenkins job to a script. The output of 'env' indicates no environment variables are set and the output of 'ant -v' indicates no properties ...
3 votes
3 answers
3k views
How to pass Git SSH credentials to Gradle release plugin in Jenkins?
I’m trying to employ the Gradle release plugin on our client’s Jenkins (1.x, so no Jenkinsfile pipelines… 😟). I tested it on my box, and everything is well. However, when I invoke the build job, it ...
0 votes
2 answers
5k views
How to conditionally trigger a build in Jenkins
I have a couple of jobs both would trigger on Monday but 1 st project on 1st Monday and 2nd project on 2nd Monday. I couldn't use the Jenkins cron to trigger the project based on condition because ...
5 votes
1 answer
3k views
Jenkins EnvInject plugin - Environment variable value containing multiple lines
I followed the suggestions from this post on how to use the EnvInject plugin to create and set Jenkins environment variables. I'm using the "Inject environment variables" in post build step and set "...
7 votes
2 answers
2k views
How to setup code climate test coverage for jenkins CI
I am using code climate for code quality and test coverage. I have added the gem and code in spec_helper.rb to start the coverage. In the next step code as per the documentation: When you run your ...
2 votes
0 answers
5k views
sshpass: No such file or directory
Bellow command if i write inside a script (test.sh) and execute directly on the specific machine it works. sshpass -p $HOST_PWD sftp testuser@host <<! cd parent mkdir test bye ! But when i try ...
1 vote
1 answer
2k views
How to set Environment Variable so that it can be used in Jenkins
I am using an Environment Variable so that that it can be modified and Recipient List will consume that environment variable. So this value is passed as a build parameter: Followed to that I am ...