Reputation: 23
I have a php bluemix application created out of boilerplates.This app accepts files uploaded by user for processing.Can you please help me with below questions 1. How can I view/modify/download project files/user uploaded files on bluemix? 2. When ever I push any changes to cloud.The folder on my system replaces the entire folder along with project files and user uploaded files in bluemix.What is the mechanism we have to backup the files before pushing changes or make sure the folder with files do not get replaced when we push changes. 3. Can we connect any ftp client like filezilla so that I can view,upload and take backup of required fields. Thanks in advance for your help.
Upvotes: 1
Views: 343
Reputation: 411
When a cloud foundry app is restarted or updated, the droplet is destroyed and recreated with the new code, so everything that was added on execution time are lost.
If your app need to have information updated at execution time, then i can imagine three possible solutions:
1- Using a cloud storage, like the Cloud Object Storage as a repository for those files. The COS work in a similar way to the Amazon S3. You can see more about it here
2- Change the solution to use containers, that way if you restart or upload something new, you don't lose what was created on execution time. You can create a persistent volume to make sure nothing will be lost even if the container is destroyed.
3- This option isn't on execution time, but if there are few alterations, can be a option. You can make all alterations on a git repository, instead of upload on the app. Then restating the app with the new modifications.
About connecting with the cloud foundry app with a sftp.
The first step is to get the guid from your app
cf app myapp --guid
a8e2d87f-3f1e-4ef5-80cd-342s1ae37a79
After that, you need to get the app_ssh_endpoint, you can do that using
“cf curl /v2/info”
Also take note of the app_ssh_host_key_fingerprint.
The next step is to generate an ssh-code, to connect to a cf app using another client.
cf ssh-code
2tR9FgnrLE
sftp oPort=2222 “cf:guid/instancia”@app_ssh_endpoint
ex:
sftp -oPort=2222 "cf:a8e2d87f-3f1e-4ef5-80cd-342s1ae37a79/0"@ssh.ng.bluemix.net
This link below can give more information if needed.
Upvotes: 1