質問

I'm deploying a NodeJS application that's using ImageMagick (via node-gm) to Cloudbees. My build script is compiling it and loading the binaries into a special directory in my deployment zip:

-main.js
-path_utilities
    -imagemagick
        - bins...

The binaries are accessed via spawn() within gm, so path_utilities/imagemagick needs to be on the path. How do you modify the system PATH variable on a RUN@cloud instance?

Thanks!

Chris

役に立ちましたか?

解決

Derp - you can change the path while in the app:

process.env.PATH = process.env.PATH + ":./path_utilities/imagemagick"

EDIT: Editing the path like this works, but is crappy. The better way is to fork the clickstack you're based off of and edit the path in the application loader.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top