2

How to download the source code of the running application in bluemix?

Tried this solution Download Application files from Bluemix . But it's not working any more:

To install the plugin follow the below commands:

$ cf add-plugin-repo CF-Community http://plugins.cloudfoundry.org/
$ cf install-plugin cf-download -r CF-Community

Once the plugin is installed you can download the files using the command $ cf download <<APP_NAME>> [path]

Eg: $ cf download myapp

Community
  • 1
  • 1
Laks
  • 93
  • 1
  • 7

1 Answers1

5

I think you want this API end point.

http://apidocs.cloudfoundry.org/253/apps/downloads_the_bits_for_an_app.html

It will let you download the app bits for your app. This is what was sent up to the application with cf push. That may or may not be your source code, depending on your build pack.

Usage:

cf curl /v2/apps/$(cf app <app-name> --guid)/download > out.zip

This should work for any modern version of CF.

Yug
  • 3
  • 2
Daniel Mikusa
  • 13,716
  • 1
  • 22
  • 28
  • Saying it's not working is entirely unhelpful. You need to say why or no one can help you. – Daniel Mikusa Mar 22 '17 at 12:26
  • There is no plugin. `cf curl` is part of the core cf cli. Check your cf cli version, maybe you need to upgrade. – Daniel Mikusa Apr 05 '17 at 12:40
  • @DanielMikusa I tried the following and put the app guid. but ended up with error. I am using Windows machine with cf.exe version 6.29.0+ff886fa.2017-07-24 ```$ cf curl /v2/apps/b466072a-099b-4b83-a337-23179ae51fff/download { "code": 10000, "description": "Unknown request", "error_code": "CF-NotFound" }``` – Chandan Patra Sep 21 '17 at 18:13