Skip to content

Instantly share code, notes, and snippets.

Created April 5, 2012 19:29
Show Gist options
  • Save jordansissel/2313443 to your computer and use it in GitHub Desktop.
Save jordansissel/2313443 to your computer and use it in GitHub Desktop.
Jenkins on Heroku

Jenkins on Heroku

  1. Download jenkins.war
  2. Create pom.xml (it'll be pretty much empty)
  3. Create Procfile to do 'java -jar jenkins.war' etc...


<?xml version="1.0" encoding="UTF-8"?>
Just need a plain and mostly empty pom.xml for Heroku to detect that this is a Java application
<project xmlns=""
# Only listen on http; disable ajp and https
web: java -jar jenkins.war --httpPort=$PORT --ajp13Port=-1 --httpsPort=-1
Copy link

spudnic commented Mar 7, 2015

Seems to work like a charm for me. I have a very hacky solution which is to add the .jenkins/... directly to the git repo. For obvious reasons this is not the most secure way to do it but it does work. The tricky part is that any plugins or job configurations that I want to do need to I have to do them locally and then cp from my ~/.jenkins/ to REPO/.jenkins....

Copy link

Worked perfect for me. Thanks!

Copy link

I tried without success, too many moving parts.
I got OpenShift:

Copy link

Was anyone able to fix this?I tried what @spudnic suggested and it works but any update I make to the jobs does not get persisted after I restart the dyno. Thinking it was the write permission on the .jenkins file I did changed the writer permission (chmod -r 777) but still no change persisted. I am leaning toward using AWS.

Copy link

Tried deploying the app to heroku. Deployed successfully. On Jenkins page its asking for Administrator password. Where can I find the same. Please suggest.

Copy link

Vaults1 commented Jan 29, 2017

Did this work for anyone? @maheshwarimani1991 I think the password is password.

Copy link

@maheshwarimani1991 password is store on ~/.jenkins or $JENKINS_HOME. However, if you first start or restart dyno, you can access its log to get the pass code.
heroku logs --app your-app-name

Copy link

How do you persist configuration?

Copy link

rahil11 commented Sep 9, 2017

@HongQuanTo where exactly we have to run this command "heroku logs --app your-app-name" ?

Copy link

I have deployed jenkins on heroku and deployed successfully and accessing jenkins on heroku but after 4 5 hours it is asking for Administrator password

Copy link

ghost commented May 14, 2018

Any news today for the ephemeral problem on Heroku?

Copy link

abranhe commented Jun 15, 2018

@satnam348 I am facing the same issue, after 4 or 5 hours it is asking me for the Administrator password. Anyone know why?

Copy link

To get initial password restart the Dyno and type
heroku logs --app your-app-name where you installed heroku cli

For preventing it to sleep register site here

Copy link

Where does the jenkins create its configuration files in heroku after it has been deployed using this approach.

Since Heroku is not persisting the configuration files after restart so I want to keep all these configuration files inside the git. So after restart I do not need to configure again and it will pick from the config files. Is it possible ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment