Processing
 

Uploaded files getting deleted while redeploying in Openshift server

10/12/2014 17:10#1

Sriraman

Member

Joined at: 7 months ago

Post: 3

Thank: 0

Thanked: 0

After pushing the whole application, The whole application is working fine. Then I upload some files to my uploads folder via my web interface.

If I push the code via git, All the files in uploads folder is deleting automaticaly. Is there a way to stop this in my openshift server ?

10/12/2014 17:40Top#2

Tim

Member

Joined at: 10 months ago

Post: 354

Thank: 0

Thanked: 0

Your application should be storing any persistent files in the $OPENSHIFT_DATA_DIR, which is usually ~/app-root/data. Your application is likely storing these "uploads" into the $OPENSHIFT_REPO_DIR, where your code lives. This directory is overwritten with your new code every time you git push.

You need to configure your application to store the uploads in $OPENSHIFT_DATA_DIR to store them persistently.

28/06/2016 03:19Top#3

Ronnel

Member

Joined at: 6 months ago

Post: 1

Thank: 0

Thanked: 0

on your root wordpress local create a dir for action hook

mkdir -p .openshift/action_hooks 

then create deploy hook

vim .openshift/action_hooks/deploy 

paste this

#!/bin/bas echo "Creating symlink folder of uploads"  if [ ! -d ${OPENSHIFT_DATA_DIR}uploads ]; then     mkdir ${OPENSHIFT_DATA_DIR}uploads fi ln -svf ${OPENSHIFT_DATA_DIR}uploads ${OPENSHIFT_REPO_DIR}wp-content/uploads 

NOTE: The .openshift/action_hooks/deploy hook is not executable, to make it executable:

On Windows: git update-index --chmod=+x .openshift/action_hooks/deploy

On Linux/OSX: chmod +x .openshift/action_hooks/deploy

add changes, commit and push.

Similar articles

Non-interactive method for dpkg-reconfigure tzdata

5 years ago - Reply: 3 - Views: 140

monit is not able to read mongod.lock

2 years ago - Reply: 3 - Views: 138

Ubuntu: hadoop command not found

2 years ago - Reply: 4 - Views: 244

C# Mono Console.ReadLine quitting

4 years ago - Reply: 1 - Views: 87

linking jsoncpp on Ubuntu

2 years ago - Reply: 1 - Views: 5

Build artifacts over ssh jenkins - PHP

2 years ago - Reply: 1 - Views: 37

Can't load Metasploit after installation

2 years ago - Reply: 5 - Views: 212

Selenium FirefoxDriver in Headless get error

2 years ago - Reply: 1 - Views: 96

Unable to start MongoDB. ERROR: addr already in use

2 years ago - Reply: 2 - Views: 118

ZSH Agnoster Theme showing machine name

2 years ago - Reply: 4 - Views: 248

Unable to start firefox browser with jenkins user

2 years ago - Reply: 2 - Views: 110

vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re vé máy bay vé máy bay giá rẻ ve may bay ve may bay gia re