在IBM Cloud上部署JAR文件 [英] Deploying a JAR file on IBM Cloud
问题描述
我想在IBM Cloud上部署一个node.js工作区.工作区包含一个jar文件.是否有其他方法可以例外地部署JAR文件,或者JAR与node.js文件一起上传?我正在函数内调用JAR文件. 我只是想知道我在使用以下命令时是否上传了JAR文件:
I want to deploy a node.js workspace on IBM Cloud. The workspace contains a jar file. Is there any other way to deploy a JAR file exceptionally or the JAR gets uploaded along with the node.js files? I am calling the JAR file inside a function. Just wanted to know whether the JAR file gets uploaded or not when I use the following command:
bx cf push
推荐答案
这是Cloud Foundry文档中的说明...
Here is the explanation from the Cloud Foundry docs ...
cf推送如何找到应用程序
默认情况下,cf递归推送 推送当前工作目录的内容.或者, 您可以使用清单或命令行来提供路径 选项.
By default, cf push recursively pushes the contents of the current working directory. Alternatively, you can provide a path using either a manifest or a command line option.
如果路径是目录,则cf push递归地推送内容 该目录的名称,而不是当前工作目录的名称.如果 路径是文件,cf push仅推入该文件.
If the path is to a directory, cf push recursively pushes the contents of that directory instead of the current working directory. If the path is to a file, cf push pushes only that file.
注意:如果要 推送多个文件,但不推送一个文件的全部内容 目录中,请考虑使用.cfignore文件来告诉cf push将 排除.
Note: If you want to push more than a single file, but not the entire contents of a directory, consider using a .cfignore file to tell cf push what to exclude.
来源: https://docs.cloudfoundry .org/devguide/deploy-apps/manifest.html
基于此描述,您的jar文件将被推送.如果要阻止它被推送,可以创建一个临时的.cfignore
文件,如下所示:
Based on this description, your jar file will get pushed. If you want to stop it getting pushed, you could create a temporary .cfignore
file, something like this:
if [[ condition ]]; then
echo my.jar > .cfignore
bx cf push
rm -f .cfignore
else
rm -f .cfignore
bx cf push
fi
如果您已经拥有.cfignore
,则您的逻辑将需要删除或添加jar文件.
If you already have a .cfignore
you your logic will need to either remove or add your jar file to it.
这篇关于在IBM Cloud上部署JAR文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!