How to save sync'd file in OpenShift?

For OpenShift:

I created a test directory in ~ app-root/repo/data. I also have a local directory myapp'/data . I can click on OpenShift using git. My test files load fine, which I can check with ssh.

Now I am creating a file with nano or vim remote -file named remoteFileVim Files exist in the repo/data directory. When I do git pull locally, I do not see this remoteFileVim file.

I created a second file in app-root/data called secondVimFile . How to transfer this file to the local computer. Can i use git ? I have python 2.6, cron, mysql loaded in Openshift if that helps.

+4
source share
3 answers

If you can ssh enter the machine, you should be able to read or write files using scp .

Simply placing new files in your Openshift ~/app-root/repo/ folder will not cause the files to be included (marked) in your version control system. Typically, you should use git commit and git push to make most of the changes in your application locally, and then track by pushing these changes to your OpenShift engine.

If your application requires storage on disk or access to additional content, for example, secret tokens and keys that you prefer not to use from the source code , you can place this content in your ~/app-root/data folder. This directory is not run through deployments and has been reserved for local disk storage applications.

+4
source

Check out this blog: https://community.jboss.org/people/ozizka/blog/2013/01/06/openshift--how-to-make-uploaded-files-public

OpenShift application code is loaded using Git. Any changes to the repository directory are recreated after clicking. Therefore, saving downloaded files there will not work.

The only permanent directory you can use is .. / data. The full path is stored in the environment variable $ OPENSHIFT_DATA_DIR. However, this directory is not publicly accessible, so the URL does not lead.

The solution is quite simple - just create a symbolic link. Here is an example for PHP. Log in via SSH and run:

 mkdir app-root/data/photos cd app-root/repo/php # php/ is the only publicly accessible directory (by default, not sure if not changeable in .htaccess). ln -s ../../data/photos photos 

This makes the content in .. / data / photos publicly available at http://myapp-myaccount.rhcloud.com/photos/ . The directory for managing files can be referenced in $_ENV['OPENSHIFT_DATA_DIR'] .

+3
source

everything you do remotely (including SSH) happens in the root application. GIT uses deployment applications. you need to copy the files from the root application to the computer, and then click them using GIT. ALSO, NOT ONE / data, nor application scale. deployment applications only> current gets scaled.

0
source

All Articles