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


Openshift - trigger Jenkins build on git push

Question:

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?


Answer:

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

https://developers.openshift.com/en/managing-deployments.html#configuring-which-branch-to-deploy


Related:


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


java,jenkins,classpath,classloader
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...

Saving docker container image


jenkins,docker
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)...

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


jenkins,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...

Cartridge Python2.7 on OPenshift


python,django,openshift
I try to install Django 1.5 on host Openshift. I use cartridge Python 2.7. I read https://developers.openshift.com/en/python-getting-started.html. I did not understand where this code should be. virtenv = os.environ['OPENSHIFT_PYTHON_DIR'] + '/virtenv/' virtualenv = os.path.join(virtenv, 'bin/activate_this.py') try: # See: http://stackoverflow.com/questions/23418735/using-python-3-3-in-openshifts-book-example?noredirect=1#comment35908657_23418735 #execfile(virtualenv, dict(__file__=virtualenv)) # for Python v2.7...

Build failure due to Sonar plugin


service,jenkins,sonarqube,sonarqube5.1
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(BatchLauncher.java:91) at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75) at java.security.AccessController.doPrivileged(Native Method) at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69) at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50) at...

Upgrade SonarQube issues


service,jenkins,webserver,sonarqube,sonarqube-5.0
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...

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


jenkins,jobs
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...

Openshift port-forwarding [on hold]


java,git,netbeans,ssh,openshift
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...

Jenkins Console Output Error


jenkins,jenkins-plugins
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...

Openshift redirect to https using flask-base example


python,.htaccess,flask,openshift
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...

Find view name from jenkins GUI given the job details


jenkins,jenkins-plugins
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.

Why does `su` not work in Jenkins?


shell,jenkins,su
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. ...

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


jenkins
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...

Jenkins Flexible Publish plugin if else condition


if-statement,jenkins,jenkins-plugins
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


git,jenkins,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...

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


jenkins
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...

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


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...

Retrieving command line -D options in Java


java,maven,jenkins,jenkins-plugins
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....

running node.js sails app on openshift


node.js,deployment,sails.js,openshift
I'm trying to deploy my node.js sails app on openshift. I followed procedure outlined in https://gist.github.com/mdunisch/4a56bdf972c2f708ccc6 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...

Triggering Jenkins to run application tests when GitHub PR is created


git,jenkins,continuous-integration,ansible,continuous-deployment
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...

Get the Git Working Branch in Gradle on Jenkins


git,jenkins,gradle
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...

Some of my tests show prepended with junit.framework


java,unit-testing,jenkins,junit,junit4
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 com.test.app.RollingArchiveTest But I have 8 tests that have junit.framework prepended...

Booting up Vagrant from Jenkins throws Permission Denied


jenkins,vagrant,jenkins-plugins,vagrant-plugin
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 [...

Flask Project root directory on openshift


python,flask,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 127.2.78.1] f = open('./user.txt') [Sun Jun 21 09:05:20 2015] [error] [client 127.2.78.1] IOError:...

Install gradle on Centos


jenkins,gradle
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 https://gradle.org/downloads/, but when I unzipped I got gradle.bat file inside bin directory which tells me that this...

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


java,shell,jenkins,jenkins-plugins
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...

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


java,pdf,selenium,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...

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


powershell,batch-file,jenkins,jenkins-plugins
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...

How to block a Jenkins job from running at certain times


jenkins,jenkins-plugins
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...

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


maven,jenkins
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)...

SBT is wasting lots of disk space for dependencies each build


jenkins,sbt,playframework-2.4
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...

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


bash,shell,jenkins
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,...

Implementing security for users in jenkins


jenkins,jenkins-plugins
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...

Fail Jenkins job when nosetests fail


python,shell,jenkins,continuous-integration
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/test_integration.sh integration.sh looks like so: SETTINGS_FILE="settings/integration.py"...

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


eclipse,jenkins,eclipse-plugin,coding-style,build-automation
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.

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


jenkins,jenkins-plugins,diskspace
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...

Remote debugging tomcat with OpenShift


eclipse,tomcat,openshift,remote-debugging
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 127.5.20.129 for me which I got from command: rhc...

determine if it is jenkins environment inside gradle


jenkins,gradle,jenkins-plugins,build.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 } ...

unable to get pylint output to populate the violations graph


jenkins,jenkins-plugins
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 handlers.foo C: 1, 0: Black...

Openshift does not react on INTERVAL of MySQL


openshift
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...

Openshift - trigger Jenkins build on git push


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...

Openshift trustwave intermediate ssl cert issue


ssl,https,ssl-certificate,openshift
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 my-domain.com and have put a CNAME redirect...

using classes in jenkins job dsl


groovy,jenkins,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...

Downgrade Jenkins


jenkins,downgrade
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?

Display artifact in Jenkins Build description


plugins,jenkins
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...

How can I run the Jenkins jobs through terminal?


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

Single Jenkins instance using multiple Sonar instances


java,jenkins,sonarqube
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...

create email list of all users


groovy,jenkins,jenkins-scriptler
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


git,jenkins
I am learning Jenkins CI test & deploy as stated in the excellent tutorial http://code.tutsplus.com/tutorials/setting-up-continuous-integration-continuous-deployment-with-jenkins--cms-21511 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...