jjethwa / rundeck

GNU General Public License v3.0
122 stars 137 forks source link

Add rundeck-cli to docker image #32

Closed stagrlee closed 8 years ago

stagrlee commented 8 years ago

When running jordan/rundeck in front of a load balancer using EXTERNAL_SERVER_URL, the rd-jobs and rd-projects CLI utilities break. The rundeck devs recommend the newer rd rundeck-cli which is a rewrite of the Rundeck CLI. This pull request integrates this new debian into the docker image.

jjethwa commented 8 years ago

Hi @stagrlee

Thanks for the new PR :) I'm not experiencing the issue with the current Rundeck CLI utils breaking. My set up has Rundeck behind a load balancer (w/ SSL termination). I'm not using the EXTERNAL.SERVER_URL param though.

Some suggestions for this block: https://github.com/stagrlee/rundeck-1/blob/ebc83de768c1929ec469d687a6be440336be2d3c/content/opt/run#L139-L145

  1. If statement should also (grep) check for rundeck.tokens.file string in /etc/rundeck/framework.properties so we don't override a user's rundeck.tokens.file setting if it already exists or create multiple entries in /etc/rundeck/framework.properties
  2. https://github.com/stagrlee/rundeck-1/blob/ebc83de768c1929ec469d687a6be440336be2d3c/content/opt/run#L141-L143 - Add (If) check for the existence of /etc/rundeck/tokens.properties. If it doesn't exist, create using existing logic otherwise, see next step
  3. If /etc/rundeck/tokens.properties exists, sed changes

Would you mind updating and resubmitting the PR? I'll leave this one open until the new one is ready. Thanks again, I really appreciate it :)

stagrlee commented 8 years ago

All those changes look easy enough, I'll update the PR in a few hours.

If the rundeck server can connect to its external port network wise, the rd-jobs CLI utility can successfully follow the HTTP redirect from the rundeck server and do its job. In my case, the outside address is not accessable leaving me to need the new CLI.

stagrlee commented 8 years ago

@jjethwa think this is what you were asking for

jjethwa commented 8 years ago

Looks great, thanks! Merging :)

stagrlee commented 8 years ago

Was going to validate the merge, but the build got stuck! https://hub.docker.com/r/jordan/rundeck/builds/

jjethwa commented 8 years ago

Yeah I've been waiting too :(

stagrlee commented 8 years ago

Funny, I tweated about it and BAM! building now...

stagrlee commented 8 years ago

LATEST looks good.

jjethwa commented 8 years ago

Hmm, when I try to run the rd CI util in the container I'm getting

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/rundeck/client/tool/App : Unsupported major.minor version 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:803)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)

I believe that's because Debian's default JDK version is 7 and rundeck-cli's readme says it requires 8?

stagrlee commented 8 years ago

Interesting, my build takes your container and swaps in Oracle JRE 8 so I didn't hit that. I ran a bunch of "rd jobs load" steps in my tests and it worked great.

jjethwa commented 8 years ago

I've been thinking of switching the container over to 8 myself so it might be a good time to do that :)

jjethwa commented 8 years ago

latest is now using openjdk-8 :)

stagrlee commented 8 years ago

You need me to look into it as a follow up?

jjethwa commented 8 years ago

Latest is now on openjdk-8, so it's working now. Thanks for the offer though :)