문제

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