Reputation: 7021
I m running a jar application that uses some resources folder that needs to be in the same path as the jar:
here is an example of my folder how it uses to be :
$ ls
__files mappings wiremock-standalone-2.24.0.jar
I'm able to push the jar file using
cf push wiremock-standalone-2.24.0.jar
But not able to push the two folders mappings and __files to pcf.
When I do :
cf push wiremock/__files
Ittries to create an app named wiremock/__files:
Getting app info...
Creating app with these attributes...
+ name: wiremock/__files
path: /tmp/build/2985dd2f
What is the command line I should use ?
Upvotes: 2
Views: 2019
Reputation: 39
As suggested by @Alex Rashkov, I added the files to the jar and that worked perfectly.
My problem was exactly the same as in the original question, I want to deploy wiremock to PCF with pre-configured mappings, so I did the following:
/__admin/mappings/import
or /__admin/mappings/new
)__admin/mappings/save
)jar -uf wiremock-standalone-2.24.0.jar mappings
). I just updated the downloaded jar file directly, but I can see where you might want to update a copy as suggested above.Thanks @Alex Rashkov for the tip!
Upvotes: 1
Reputation: 10015
What you could do is add all missing files to your JAR package:
cp wiremock-standalone-2.24.0.jar wiremock-standalone-2.24.0-fat.jar
jar uf wiremock-standalone-2.24.0-fat.jar ./lib
Than your command will be exactly the same all you have to do is point to the new resources inside the Java app.
Upvotes: 3
Reputation: 5125
cf push
is used to deploy an application to a container. Anything that is deployed with cf push
is expected to be an executable app. Even if you were able to cf push wiremock/__files
successfully, the files would end up in a different container and inaccessible from the container created for cf push wiremock-standalone-2.24.0.jar
.
It sounds like you need the jar file, __files
, and mappings
to all be in the same container. To make this happen, you'll need to bundle them all into an archive and cf push
them together.
Upvotes: 1