Deploying a JAR file on IBM Cloud

狂风中的少年 提交于 2019-12-11 12:28:21

问题


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

回答1:


Here is the explanation from the Cloud Foundry docs ...

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

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

If you already have a .cfignore you your logic will need to either remove or add your jar file to it.



来源:https://stackoverflow.com/questions/49573331/deploying-a-jar-file-on-ibm-cloud

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!