jenkins,openshift , Openshift - trigger Jenkins build on git push

Openshift - trigger Jenkins build on git push


Tag: jenkins,openshift

I work with Openshift now and I have a problem. I created an application server with Jenkins and when I push to the master branch of the git repository the Jenkins build is triggered automatically. The point is that the build isn't triggered when I push to another branch (not master).

I've read topics like this one (How to configure Git post commit hook) and I do realize what the ways to make Jenkins build on git push are.

Unfortunately I haven't found any information about how this is done in the Openshift Jenkins. This mechanism is already implemented there and I simply want to replace the trigger from the "master" branch to another one.

How can I do it?


You can refer to the "Configuring Which Branch to Deploy" section from the following page:


Build failure due to Sonar plugin

My build keeps failing on Jenkins because of this error: ERROR: Error during Sonar runner execution org.sonar.runner.impl.RunnerException: Unable to execute Sonar at org.sonar.runner.impl.BatchLauncher$1.delegateExecution( at org.sonar.runner.impl.BatchLauncher$ at Method) at org.sonar.runner.impl.BatchLauncher.doExecute( at org.sonar.runner.impl.BatchLauncher.execute( at...

How can I run the Jenkins jobs through terminal?

I heard an version that webhooks could be used for this. Please help)

Get the Git Working Branch in Gradle on Jenkins

I want to have the current Git branch in the Version name of my Android app. I built in this snippet from here into my build.gradle: def getWorkingBranch() { // Triple double-quotes for the breaklines def workingBranch = """git --git-dir=${rootDir}/git --work-tree=${rootDir}/.. rev-parse --abbrev-ref HEAD""".execute().text.trim() print "Working branch: " + workingBranch...

Single Jenkins instance using multiple Sonar instances

Is it possible to configure Jenkins to use multiple Sonar instances? Currently we are using one Sonar instance for legacy projects (Java 6) and a new Sonar instance for Java 8...

Jenkins Console Output Error

We've been using Jenkins for a while now, but recently we've added a couple plug-ins to the configuration and our Console Output is not showing in real-time anymore, we just get a big fat Java error! I've removed the offending plug-ins (emotional jenkins and Green Spot) in an attempt to...

How to force team members to comment using eclipse plugin or something else

Currently, I am working in a new project and it was difficult for me to understand since there is no comment. I wonder if it is possible to force team members(including me) to add more comments. I would like to automate this ject in jenkins later if possible.

Openshift trustwave intermediate ssl cert issue

So I have got an application on openshift and I am trying to enable SSL on there. I already have an SSL cert from my previous host which is with Trustwave and seemed to work fine. So I have setup an alias for and have put a CNAME redirect...

unable to get pylint output to populate the violations graph

my build steps: cd $WORKSPACE export TERM="linux" . venv/bin/activate pylint --rcfile=pylint.cfg $(find handlers -maxdepth 1 -name "*.py" -print) > pylint.log || exit 0 result of pylint.log: ************* Module handlers C: 1, 0: Missing module docstring (missing-docstring) C: 8, 0: Missing function docstring (missing-docstring) ************* Module C: 1, 0: Black...

Avoid large log Jenkins file (and stop build if needed)

We are using Jenkins (on Linux) to manage our Maven builds. Our users can create their own job and sometimes (3 or 4 times per year), they are doing a mistake and the job generates a large log file (79 GB the last time...). I had a look to existing...

How to access jenkins parent job build id in a MultiJob?

I have a requirement to trigger Automation Suite in multiple phases and summarize test results in a single test summary report. I configured a Jenkins Multi Job to trigger my automation suite, which is divided in to multiple chunks say suite#1, suite#2, suite#3, suite#4 (each suite is a maven job)...

Excluding jobs that haven't run recently from a view in Jenkins

Is it possible in Jenkins to exclude jobs from a view if they have not run recently? I would like our default view to exclude jobs that have not run in the past month, because we don't need to see jobs from parts of the product that are not under...

Remote debugging tomcat with OpenShift

I am using openshift for my tomcat webapp. I am able to run the app but unable to debug it. As openshift starts tomcat in debug mode, I was expecting I'll be able to debug. Host: $OPENSHIFT_JBOSSEWS_IP Value of this is for me which I got from command: rhc...

Openshift does not react on INTERVAL of MySQL

I have tested the table test on the locanhost and Openshift and I am facing problem that on openshift I am not getting anything back when I query the data like this WHERE arrivaltime BETWEEN curtime() - INTERVAL 2 MINUTE AND curtime() + INTERVAL 2 MINUTE although on the localhost...

Advantage of Jenkins Master/Slave architecture? [on hold]

I am reading about the Jenkins Master/Slave architecture and how to configure it from here and as I am going down the page I am wondering why should I do it, what benefit I can achieve through it. I searched similar questions and reached here but still not convinced about...

determine if it is jenkins environment inside gradle

I am just wondering is it possible that I can tell whether I am in a Jenkins environment inside gradle? I just want to do something like if (jenkins){ //do something }else{ //do other } ...

How to block a Jenkins job from running at certain times

I have a Jenkins job which restarts our small in-house production system. It is fully automated, so when we check-in code changes, we run tests and other verification steps and finally automatically deploy the new version. It is usually not a problem restarting the system as it will be back...

Triggering Jenkins to run application tests when GitHub PR is created

I am a noob to Jenkins, and I have a Jenkins server that runs an ansible playbook to deploy the app. I would like to be able to have Jenkins run an ansible playbook which runs application python tests when a GitHub pull request is opened. I would then like...

can't export a variable from execute shell in Jenkins to other project (with using properties file)

I have a Jenkins project with one "Execute shell" that executes some bash commands and exports one variable to the env. variables: #!/bin/bash ... TARGET_FULLPATH="blablabla" export TARGET_FULLPATH In addition, I have configured to "Post-build Actions" with: "Trigger parameterized build on other projects" "Current build parameters" "Predefined parameters" -> FULLPATH=$TARGET_FULLPATH But,...

Openshift port-forwarding [on hold]

After many hours and many attempts, remains now your help. Im trying to do port-forwarding to access my DB in Openshift on Neatbeans. I've already done lots of tutorials, upgrade and downgrade versions of net-ssh, uninstall rhc and so on. I have read a lot git solutions (ssh_options[]...) and doesn't...

Install gradle on Centos

I'm trying to install gradle for building android app with the help of Jenkins. But I'm not able to find the link to download gradle for Centos. I tried to use binaries from, but when I unzipped I got gradle.bat file inside bin directory which tells me that this...

Fail Jenkins job when nosetests fail

I am managing deployment / CI of a Flask app through Jenkins. I have a build step in the form of an executed shell which runs a shell script in the host that in turns runs nosetests. The Jenkins shell command looks like so: $WORKSPACE/ops/ looks like so: SETTINGS_FILE="settings/"...

Saving docker container image

I created a new docker container using jenkings image This is the command I ran docker run -p 8080:8080 -v /var/jenkins_home jenkins I created a few jobs on the jenkins instance and commited the image docker commit 7b903d061654 test When I run the image I created using the command (below)...

How do I print the current classpath for a Jenkins plugin?

I'm developing a Jenkins plugin but I'm having a few problems which I think might be due to a jar missing in the plugin's classpath even though its in the plugin's WEB-INF/lib directory. Normally I would use the following code in Java to print the classpath but this doesn't seem...

using classes in jenkins job dsl

Hi all I have a problem and I can't seem to figure it out. So I'm creating some helper classes for my dsl to use, but it just does not seem to execute any method within these classes. I have created a job with the following dsl in it: class...

Display artifact in Jenkins Build description

I would like to automatically display a artifact as part of the build description. Now I can do this by manually editing the build description but that would mean I have to do this for every build. Is there a way to automate this? This is what I would like...

Cartridge Python2.7 on OPenshift

I try to install Django 1.5 on host Openshift. I use cartridge Python 2.7. I read I did not understand where this code should be. virtenv = os.environ['OPENSHIFT_PYTHON_DIR'] + '/virtenv/' virtualenv = os.path.join(virtenv, 'bin/') try: # See: #execfile(virtualenv, dict(__file__=virtualenv)) # for Python v2.7...

how to identify user who created a specific job on jenkins?

Problem In jenkins, I cannot find the job creator for a specific task. Tries I tried looking in the changes log, do not display creation. Looked up in the user profiles and there is no such properties. Been fooling aroung for a while now trying to find it. Also most...

SBT is wasting lots of disk space for dependencies each build

We have a Playframework 2.4 (with SBT 0.13.8) project which we build on a Jenkins. Today, the Jenkins stopped working because his $JENKINS_HOME run full. I analyzed which tool was wasting the disk space: SBT. There is a folder located at .sbt/0.13/dependency/module/dynamic that contains quadrillions of subfolders. Each of these...

Is it possible to save an adobe pdf file using selenium web driver and one click build Jenkins

Here's my dilemma. I'm creating some automation tests using selenium web driver coding in Java. The main output of the software is to load a PDF in adobe acrobat. I'm also using Jenkins which is why my problem has come about as I wont be able to physically see the...

Openshift redirect to https using flask-base example

I'm trying to run my flask based app on free gear on Openshift only on https. Following this - I have added the .htaccess file to the root of my repo but it seems to be ignored, as it is not redirecting. The article talks about a wsgi directory but...

create email list of all users

On occasion I need to email all Jenkins users, for example warning them Jenkins will be offline for maintenance. The script below gives me email addresses for all people that Jenkins knows about, but it includes people that don’t have accounts, these are people that have committed changes that triggered...

Jenkins continuous deployment error

I am learning Jenkins CI test & deploy as stated in the excellent tutorial at the end of the tutorial, it should handle the deployment of the app... as per the deploy script and the Jenkins project config w ./script/deploy #!/bin/sh ssh [email protected] <<EOF cd ~/hello-jenkins git pull npm...

Retrieving command line -D options in Java

I have clean integration-test -DclassId=appas a maven goal in a Jenkins Maven Job. How can I retrieve this in Java using System.getenv();? When I do this I am only seeing null....

Jenkins execute shell on job's executor during CONFIGURATION time (and access workspace)

I would like to create a simple Jenkins plugin. Basically it is a custom build step (Builder extension) with a dropdown list. The trick is that I want to fill this dropdown list from the result of a shell script/command executed during configuration time. Here is my method stub. public...

Downgrade Jenkins

I updated Jenkins some days ago. But in current Jenkins version, there are some annoying bugs. Is it possible, to downgrade the version of Jenkins and when it's possible, how is it possible?

Flask Project root directory on openshift

I'm getting started with flask and I'm deploying my app to openshift. My apps code: def get_users(): f = open('./users.txt') .... when I run: $ rhc tail flaskpq I see: [Sun Jun 21 09:05:20 2015] [error] [client] f = open('./user.txt') [Sun Jun 21 09:05:20 2015] [error] [client] IOError:...

Jenkins Flexible Publish plugin if else condition

I am using the flexible publish plugin for jenkins and found it very useful. My goal is to pass a set of predefined parameters from a job to trigger another downstream job. The downstream job performs an action based on the string match evaluation. But if i dont pass the...

Jenkins does not find my git repository in Visual Studio Online

I have a Visual Studio Online project working with Git. Everything works fine from inside Visual Studio. I'm trying then to configure a Jenkins job that gets the code from this project, but without success. Although the URL and the credentials are correct, Jenkins gives me this error on the...

Upgrade SonarQube issues

I'm having issues installing my instance of SonarQube 4.4 to 5.1. The instructions say to stop the SonarQube server, match up a couple files (back up DB, copy plugins, etc.), and then restart the sonar server for the updated version. My problem is I'm not sure how to start/stop the...

Booting up Vagrant from Jenkins throws Permission Denied

I am trying to Boot up Vagrant VM from Jenkins. I gave Vagrantfile path in 'Boot up Vagrant VM'. When the job runs, I get the following error: Failed to iterate on remote directory vagrant_projs [ vagrant ]: Executing command :[vagrant, up] in folder /Users/abc/Desktop/vagrant_projs [vagrant_projs] $ vagrant up [...

Find view name from jenkins GUI given the job details

I have few hundreds of jenkins jobs all classified into different views based on different projects. So, I already have around 30+ views in Jenkins. My question is, Given a jenkins job name can I find out which View it is classified into.

Jenkins (cloudbees): remotely trigger build (e.g.via instant message) w/o creating user account in Cloudbees

We're using Jenkins (and precisely Cloudbees) for couple years. Well, it works. Not I have new use case when I would like to allow trigger build remotely (w/o user account in Cloudbees). Looks like it's impossible (standard token trigger mechanism requires an account in Cloudbees). The only one way that...

Why does `su` not work in Jenkins?

su doesn't seem to work as intended when run in Jenkins build job script. su username1234 whoami returns jenkins My initial guess is that each line of the Jenkins shell script is a new shell. But doing repeated echo $$ on separate lines shows that's not the case. ...

Some of my tests show prepended with junit.framework

I have a set of junit tests that run automatically on my build server (Jenkins). I run more than 500 tests. Most of them, in the test results view, show up with the correct package value Example : results for But I have 8 tests that have junit.framework prepended...

Execute SVN Update in Jenkins - Copy a Folder to Web root Explicitly from SVN as a Build Step

I'm new to Jenkins CI.I'm trying to get SVN update (myFolder) inside a job as build steps. I want to explicitly copy some files to web root as I can't have them inside my solution. Build Steps I need to perform. Build Solution Publish Copy myFolder to web root Sync...

Openshift - trigger Jenkins build on git push

I work with Openshift now and I have a problem. I created an application server with Jenkins and when I push to the master branch of the git repository the Jenkins build is triggered automatically. The point is that the build isn't triggered when I push to another branch (not...

running node.js sails app on openshift

I'm trying to deploy my node.js sails app on openshift. I followed procedure outlined in but still doesn't work. also try this: Node.js app on openshift no matter what i'm getting "Service Temporarily Unavailable" The server is temporarily unable to service your request due to maintenance downtime or capacity...

How to display all keep forever build number using Jenkins REST API for a specific job?

I read the following post which does what I want for all jobs (and I made it works) List all keep-forever builds in Jenkins? here is what I have now : http://jenkinsmediaprocessor:7880/api/xml?depth=2&xpath=/hudson/job/build[keepLog=%22true%22]/url&wrapper=forever But I only want to display a specific task. However I don't know where to set the job...

Implementing security for users in jenkins

I am after a better solution for security in Jenkins. After my play around this space, my current solution is to implement the 'Project-based Matrix Authorization Strategy'. I was previously considering running Jenkins behind Apache and control security through Apache. But during my trial with matrix based security, I was...