如何使用Action Hook在OpenShift上安装Bower



我在OpenShift上的Java环境中使用WildFly应用程序服务器。在我的pom.xml文件中,我指定运行bower install(使用exec-maven-plugin)。

使用exec-maven-plugin运行bower install需要在操作系统上存在Bower,但默认情况下,我的OpenShift实例没有Node.js&Bower已安装。

是否可以安装Bower per Action Hook?

我用"预构建操作挂钩"尝试了以下操作:

/.openshift/action_hooks/pre_build

#!/bin/bash
npm install -g bower

我还执行了以下操作:

git update-index --chmod=+x .openshift/action_hooks/pre_build

但看起来我的Action Hook没有执行:

Not stopping cartridge wildfly because hot deploy is enabled
Repairing links for 1 deployments
Syncing git content to other proxy gears
Building git ref 'master', commit f330f6d
No such file or directory - /var/lib/openshift/54e8f8984382ecc9a1000047/app-root/runtime/repo/.openshift/action_hooks/pre_build

看起来,它是被执行的。如果hooks目录下的bash脚本文件本身丢失,它不会抱怨。

显然,文件中出现了返回"无此类文件…"错误的情况。

试着在脚本中使用一些echo语句,看看它是否被执行,并进一步了解发生了什么。

最新更新