I was able to fix a bug that I couldn't fix so far, so make a note of it.
Usual environment:
local: git push origin master
↓
remote(bare): post-git pull with receive
↓
remote(cloned): post-python script execution with merge
With these preferences, run the post-merge script and
When ʻimporta third-party module in that script (The module is properlypip install), For some reason git push` raises ** ImportError ** on that third party module
The reason why I get such an error is that I have multiple Pythons installed in remote and unintended Pythons are running (ie I don't use the location where I did pip install). Python is used).
For example
/usr/bin/python$HOME/.pythonbrew/pythons/Python-2.7.3/bin/pythonI want to use ** 2 ** Python when I have two, but ** 1 ** Python is running.
So don't just run post-merge.py,
When I bite ** shellscript ** and run it, it ran successfully.
In other words
post-merge.sh
#!/bin/sh
BIN="$HOME/.pythonbrew/pythons/Python-2.7.3/bin/python"
$BIN $HOME/path/repo/post-merge.py
post-merge.py
import flask
Ah, good, this works.
Recommended Posts