Punter Vicky
Punter Vicky

Reputation: 16992

Download the deployed War from cloud foundry

Is there a way to download the deployed War from cloud foundry? I want to explode the war and check if the property files in the war are correct.

Upvotes: 1

Views: 6546

Answers (2)

Daniel Mikusa
Daniel Mikusa

Reputation: 15051

First thing...

Is there a way to download the deployed War from cloud foundry?

The WAR file is not uploaded to Cloud Foundry. The cf cli will look at the WAR file and extract everything from it. It does not upload the file as a whole, but the individual files in it. It's a minor difference, but worth noting because the WAR file itself doesn't exist on the server, just it's contents.

I want to explode the war and check if the property files in the war are correct.

If you're looking for an individual file then as mentioned previously cf files is one way to go. Alternatively you could use Eclipse w/the CF plugin. That allows you to browse files via a GUI.

If you need lots of files or want the whole app, a better option is to download the droplet that's being used to run your app. As long as your application finished staging successfully (i.e. the build pack ran and finished), you should be able to download the droplet that was built by CF. That should contain amongst other things your application code.

Ex:

$ cf app <app-name> --guid
2836d5fe-35f7-4409-b27b-4ed308152bb4
$ cf curl /v2/apps/2836d5fe-35f7-4409-b27b-4ed308152bb4/droplet/download > my-droplet.tar.gz

Upvotes: 3

Ram Vennam
Ram Vennam

Reputation: 3546

There is no direct way to download your application from a running cloud foundry container. However, you can use the cf files <appname> [path] command to explore and even download one file at a time.

cf files ramhellojava app
Getting files for app ramhellojava in org ....
OK

.java-buildpack/                             -
.java-buildpack.log                     136.3K
META-INF/                                    -
WEB-INF/                                     -
images/                                      -
index.html                                773B
index.js                                  1.1K
style.css                                 1.1K

Upvotes: 4

Related Questions