java - 在 IBM Cloud 上部署 JAR 文件

标签 java node.js jar ibm-cloud

我想在 IBM Cloud 上部署一个 node.js 工作区。工作区包含一个 jar 文件。是否有其他方法可以异常部署 JAR 文件或者 JAR 与 node.js 文件一起上传?我在函数内调用 JAR 文件。 只是想知道当我使用以下命令时 JAR 文件是否上传:

bx cf push

最佳答案

这是 Cloud Foundry 文档的解释...

How cf push Finds the Application

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.

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.

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.

Source: https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html

根据此描述,您的 jar 文件将被推送。如果您想阻止它被推送,您可以创建一个临时 .cfignore 文件,如下所示:

if [[ condition ]]; then
    echo my.jar > .cfignore
    bx cf push
    rm -f .cfignore
else
    rm -f .cfignore 
    bx cf push
fi

如果您已经有 .cfignore,您的逻辑将需要删除或添加您的 jar 文件。

关于java - 在 IBM Cloud 上部署 JAR 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49573331/

相关文章:

java - 可比较的比较器

java - 从 For 循环 Java 返回字符串值

node.js - Node : any module to limit express request rate

java - jar无法访问txt文件

gradle - 如何从 java TestRunner 类运行 cucumber 测试

Java 用 lambda 替换方法

java - 从列中选择数据

node.js - Express 未知错误处理程序正在记录自定义错误

javascript - 在 node.js 中使用 require() 出现奇怪的 JSON 解析错误

java - 什么是 MANIFEST.MF 中的 list 版本?