问题描述
当我在OpenShift中创建一个测试DIY应用程序时, action_hooks
工作正常,但现在我创建了一个实际的应用程序,并且当我推送更改时它们不会触发。
我做了一些调查,发现问题 - 出于某种原因,操作挂钩不可执行。我检查了它们,它们在测试应用程序(它们工作的地方)中是可执行的 - 但现在它们不是。
chmod $ c $因为每次我推送一些更改时,OpenShift将新的repo文件夹复制到旧的(而不是使用git来更新它),所以权限被重置。我研究了使用git的
post-receive
钩子使它们可执行,但OpenShift上的git钩子受到保护,我无法编辑它们。
有什么办法可以解决这个问题吗?
PS。我不知道它是否有任何影响,但我的实际开发回购在Google Code上,我使用将OpenShift repo设置为本地回购的上游。
当我创建应用程序时,而不是编辑动作我从第一个应用程序的回购(我创建的应用程序尝试OpenShift DIY)中复制了动作钩子。我认为发生的事情是,Git检测到文件已被替换,未被编辑并将它们视为新文件。
为了解决这个问题,我遵循,以便从OpenShift Template Builder的提交中恢复旧文件,现在它可以工作!
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.
chmod
ing 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.
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!
这篇关于OpenShift action_hooks不可执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!