gpt4 book ai didi

java - 在 IBM Cloud 上部署 JAR 文件

转载 作者:太空宇宙 更新时间:2023-11-04 01:51:19 25 4
gpt4 key购买 nike

我想在 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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com