Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SHARED env variable in post-deploy hook is blank #6

Open
slaskis opened this issue Oct 12, 2011 · 2 comments
Open

SHARED env variable in post-deploy hook is blank #6

slaskis opened this issue Oct 12, 2011 · 2 comments

Comments

@slaskis
Copy link

slaskis commented Oct 12, 2011

Hey, I'm trying to use a little hook magic for my node server, something like this:

post-deploy npm install && (cat $SHARED/pids/master.pid | xargs kill -s SIGUSR2) || PORT=8001 node server.js >> $SHARED/logs/node.log 2>&1

and well, it fails because $SHARED is blank, so I tried this to confirm:

post-deploy env

which listed SHARED=/home/deploy/app/shared as expected, but trying this:

post-deploy cat $SHARED/pids/master.pid

fails with cat: /pids/master.pid: No such file or directory, in other words SHARED is blank...

am I using it wrong?

It's on ubuntu 10.4 (installed using the node knockout linode stack script )

@tj
Copy link
Member

tj commented Oct 12, 2011

hmmm not too sure off hand, i'll have to take a look

@bronson
Copy link
Contributor

bronson commented Apr 26, 2012

Sounds like your command is being interpreted twice: the local shell sees the variable and replaces it with blank, hiding it from the remote shell where $SHARED is actually set.

Maybe try cat \$SHARED/pids/master.pid or cat '$SHARED/pids/master.pid' or various combinations of escaping to get the variable to arrive where it can be used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants