2

I want to use the pandoc markdown plugin for jekyll on Openshift. This requires changing the PATH variable, such that the pandoc executable can be placed in the $OPENSHIFT_DATA_DIR. I've forked the jekyll cartridge and attempted to mimic the way env is setup in bin/setup there.

The ruby path element was setup like this:

dirname $(scl enable ruby193 "which ruby") > $env_dir/OPENSHIFT_RUBY_PATH_ELEMENT

So, I tried this:

dirname $(scl enable ruby193 "printenv OPENSHIFT_DATA_DIR") > $env_dir/OPENSHIFT_JEKYLL_PATH_ELEMENT

Thinking that perhaps this counted as a ruby cartridge, even though the short name is "jekyll," I also tried:

dirname $(scl enable ruby193 "printenv OPENSHIFT_DATA_DIR") > $env_dir/OPENSHIFT_RUBY_PATH_ELEMENT

I also tried:

dirname echo $OPENSHIFT_DATA_DIR > $env_dir/OPENSHIFT_JEKYLL_PATH_ELEMENT
dirname echo $OPENSHIFT_DATA_DIR > $env_dir/OPENSHIFT_RUBY_PATH_ELEMENT

Finally, in env/ I placed a file OPENSHIFT_JEKYLL_PATH_ELEMENT.erb with the following line:

<%= ENV['OPENSHIFT_DATA_DIR'] %>

My reason for attempting this last was due to the cartridge developer's guide:

The PATH variable is set by OpenShift with the base being /etc/openshift/env/PATH. If you provide an OPENSHIFT_{Cartridge-Short-Name}_PATH_ELEMENT, OpenShift will include the value when building the PATH when your scripts are run or an application developer does an interactive log on.

SSHing to the server and checking echo $PATH revealed no change to the environment variable. I've read the other questions regarding openshift and setting the path and I either try those solutions above or they find some way to avoid setting the path.

I'm lost…

Community
  • 1
  • 1
sam
  • 323
  • 1
  • 8

1 Answers1

0

That would probably need to be done in an Action Hook on your application. Basically you'll append your steps above to the deploy script to see if you can change that $PATH value.

niharvey
  • 2,807
  • 2
  • 15
  • 24