4

When I created a test DIY application in OpenShift, the action_hooks worked fine, but now I created an actual application and they just don't fire when I push changes.

I did some investigating, and I found the problem - for some reason the action hooks are not executable. I checked and they were executable in the test application(where they worked) - but now they aren't.

chmoding them doesn't help, since every time I push some changes OpenShift copies the new repo folder over the old one(instead of using git to update it), so the permissions are reset. I looked into using git's post-receive hook to make them executable, but the git hooks on OpenShift are protected and I can't edit them.

Is there any way to solve this problem?

PS. I don't know if it has any impact, but my actual development repo is on Google Code, and I used this tutorial to set the OpenShift repo as an upstream for my local repo.

Idan Arye
  • 12,402
  • 5
  • 49
  • 68

2 Answers2

4

In the OpenShift tooling for JBoss Tools, we faced the very same problem. Our implementation was resetting the execute permissions on the hook files causing the hooks to get ignored: https://issues.jboss.org/browse/JBIDE-13217 In our case having +x on these again solved the issue. You seem report some repo being copied over yours, which I dont really get. How is this occurring to you? It could help if you could show some of your setup?

adietisheim
  • 3,434
  • 1
  • 19
  • 14
  • Well, this is my GoogleCode repository: https://code.google.com/p/ilender/source/browse/ . I think the problem is in my configurations on the OpenShift servers. If you give me your public key I can add it to the allowed keys and let you SSH into it. – Idan Arye Feb 06 '13 at 17:26
1

OK, I figured it out.

When I created the application, instead of editing the action hooks I copied the action hooks from the repo of the first application(the the application I created to see try out the OpenShift DIY). I think that what happened is that Git detected that the files were replaced and not edited and treated them as new files. OpenShift somehow read this, and haven't given them the execute permissions of the original files.

To fix this, I followed this answer to restore the old files from the OpenShift Template Builder's commit, and now it works!

Community
  • 1
  • 1
Idan Arye
  • 12,402
  • 5
  • 49
  • 68
  • Haven't tried it, but the windows solution here might also work fro Linux: http://openshift.github.io/documentation/oo_cartridge_developers_guide.html#notes-on-script-execution – Idan Arye Nov 11 '13 at 16:55
  • 1
    And here is an actual solution for setting file permissions via Git: http://stackoverflow.com/a/7048915/794380. – Idan Arye Jan 30 '14 at 14:29