SAP商业1905
我有一个节点应用程序,我想要与我的海布里集成。我已经创建了一个自定义的addon,并将我的节点应用程序文件放入了addon扩展名中。现在,我想在海布里服务器启动上运行下面的命令。
nohup npm start > output.log&通过将npm命令放在myextension_compileuisrc_executor构建回调下,我能够在ant构建中启动节点服务器。
但我的目标是只在myextension_compileuisrc_executor上执行npm安装,而不是节点服务器启动。
这就是为什么我正在研究在海布里服务器启动上启动node.js服务器的方法。在buildcallback中找不到任何可以插入服务器启动命令的目标。
如何做到这一点?
更新:
我也和myextension_before_startHybrisServer试过了,但没有运气-
<macrodef name="myextension_before_startHybrisServer">
<sequential>
<npm-start/>
</sequential>
</macrodef>发布于 2020-05-12 03:07:24
嗨,我试着写一个普通的宏
<sequential>
<echo message="JJJJJJ RAUSHAN JAAAA" />
</sequential>
</macrodef>
output:
[echo] JJJJJJ RAUSHAN JAAAA
[echo] Checking lock flag for the platform
[exec] --> Wrapper Started as Console
[exec] Java Service Wrapper Professional Edition 64-bit 3.5.29命令:>ant startHybrisServer
发布于 2020-05-11 05:46:34
嗨,请试着在构建-回调中编写自定义微。
<macrodef name="xxxstorefront_getnpm">
<sequential>
<echo message="Checking for NPM" />
<if>
<os family="windows" />
<then>
<exec dir="${platformhome}" executable="cmd.exe" osfamily="windows">
<arg line="/c" />
<arg line="npm.bat" />
</exec>
</then>
<else>
<exec dir="${platformhome}" executable="sh" osfamily="unix">
<arg line="-c ./npm.sh" />
</exec>
</else>
</if>
</sequential>
</macrodef>然后像这样添加这个回调的引用。
<macrodef name="xxxstorefront_compileuisrc_executor">
<sequential>
<xxxstorefront_getnpm/>
</sequential>
</macrodef>发布于 2020-05-11 14:45:08
有一个解决办法,你可以试试。
请制作一个像这个\hybris\config\customize\platform\resourcesant/platformadministration.xml的文件夹
并复制现有的platformadministration.xml并创建自己的微定义:
<macrodef name="xxxstorefront_getnpm">
<echo message="Checking for NPM" />
<if>
<os family="windows" />
<then>
<exec dir="${platformhome}" executable="cmd.exe" osfamily="windows">
<arg line="/c" />
<arg line="npm.bat" />
</exec>
</then>
<else>
<exec dir="${platformhome}" executable="sh" osfamily="unix">
<arg line="-c ./npm.sh" />
</exec>
</else>
</if>
</sequential>
然后创建文件\hybris\config\customize\platform\build.xml
并在build.xml中添加新创建的微定义,就在此之上。
<target name="startHybrisServer" description="Starts the hybris Server">
<callback extname="" target="before_startHybrisServer"/>
<--**CUSTOM MICRO DEF**>
<startHybrisServer/>
<callback extname="" target="after_startHybrisServer"/>
</target>然后保存文件并运行>> ant自定义。
ant clean && hybrisserver.bat
https://stackoverflow.com/questions/61556778
复制相似问题