mlomnicki/dokku-deploy-hooks

Pre-deploy hook not detected

lucasm-iRonin opened this issue · 6 comments

Hey,
For some reason pre-deploy file wasn't detected - I had a code in a post-deploy file which was executed correctly on every deploy. When I renamed it to pre-deploy and push the code it wasn't detected. I tried to debug it but I wasn't able to find out what was the problem. When I destroyed my app and created it again, hook was detected and executed correcly.

@mlomnicki do you have any idea why this could happen? I'm sorry I don't provide exact steps to reproduce but I don't know what was the problem - after re-crating the app everything works fine and problem is gone.

PS. I'm using additional plugins like:

Hi Lucas!

If you had some logs or a snapshot of this container then maybe I could help. Otherwise it's really hard to say what could have caused that

@mlomnicki thanks for your answer.

Unfortunately I've encountered this issue again, basically this is what I see during deploy:

-----> Running pre-deploy hooks
remote: app image (dokku/app:hash) not found
       deploy/pre-deploy not found or executable bit not set. Skipping ...

I replaced original app name and hash with app:hash placeholder. The hash contained the hash of previous app (previous docker image). chmod +x has been set for deploy/pre-deploy file so it's not the issue.

When I deployed again, it also couldn't find pre-deploy file - hash has been changed to the version I deployed just before this one.

Also when I removed post-deployed it works fine - it can not find it. So it looks like this issue affects only pre-deploy hook.

@mlomnicki When I modified functions file directly on the server by adding: dokku run $APP ls (just before checking if hook file exists) the whole deploy is rejected. With tracing enabled (dokku trace on):

I've noticed that the problem is caused by the fact that ls command returned app image (...) not found.

Can it be caused by the fact that use used push by force (push -f) a few commits before?

I think this is a bug in dokku, meanwhile you can use #11.

Currently I switched to https://github.com/michaelshobbs/dokku-app-predeploy-tasks.

@ebeigarts could you describe a little bit more in detail this bug in dokku?