WebFaction
Community site: login faq

I've got some really simple post-receive hooks which will checkout my repo to the proper location, run collectstatic for my Django app, and run pip to install any dependencies. The checkout and collectstatic work, but I get an error on the pip install. Here's my post-receive:

#!/bin/sh
echo "Deploying live site..."
GIT_WORK_TREE=/home/raddevon/webapps/radworks/radworks-mezz git checkout -f
echo "Running collectstatic..."
python2.7 /home/raddevon/webapps/radworks/radworks-mezz/manage.py collectstatic --noinput
pip2.7 install -r /home/raddevon/webapps/radworks/radworks-mezz/requirements.txt --target=/home/raddevon/webapps/radworks/lib/python2.7 --install-option="--install-scripts=/home/raddevon/webapps/radworks/bin"

And the error:

remote: hooks/post-receive: line 6: pip2.7: command not found
error: cannot run hooks/post-receive: No such file or directory

I can pull the pip command out and run it via SSH with no problem, but it won't run in the post-receive. Can anyone help me figure out how to fix this?

asked 01 May '14, 13:25

raddevon
1114
accept rate: 0%

That appears to have worked. Thank you! If you'll post it as an answer, I'll mark it correct. Any idea why I'm able to run python2.7 without the full path but not pip2.7?

(01 May '14, 15:55) raddevon

Does it work if you specify the full path in your script to your pip command?

permanent link

answered 01 May '14, 14:27

bmeyer71 ♦♦
1.5k3613
accept rate: 33%

pip is installed into your home directory and will only be available on your pythonpath through a shell session. If your script is being run without being logged in, for example through cron, it will run through it's own shell.

(01 May '14, 16:03) bmeyer71 ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×337
×111
×54
×32
×2

question asked: 01 May '14, 13:25

question was seen: 3,126 times

last updated: 01 May '14, 16:03

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM