Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to link uploads folder? #12

Open
wreeecks opened this issue Oct 26, 2015 · 5 comments
Open

How to link uploads folder? #12

wreeecks opened this issue Oct 26, 2015 · 5 comments

Comments

@wreeecks
Copy link

Hi,

After deploying the app, all the uploaded images were deleted or maybe moved to somewhere else. I'm not sure what's happening when i deploy something.

How do I automatically link the uploads folder to the openshift data dir? or better if the files on the upload folders are preserved. I've tried adding a link command on deploy script but sadly it didn't work. Can you please assist me in setting this up. Thanks in advance!

ln -sf ${OPENSHIFT_DATA_DIR}public/uploads   ${OPENSHIFT_REPO_DIR}public/uploads
ln -sf ${OPENSHIFT_DATA_DIR}public/cards   ${OPENSHIFT_REPO_DIR}public/cards
@vignesh0025-zz
Copy link
Contributor

How come its deleted ? If you are pushing from windows, I think there is a problem with the Uppercase and Lowercase naming of images.
In Windows, address is case -insensitive
in Unix or Mac, it is case-sensitive

This problem had occurred to me once. I ignored to have correct case. In windows, the Site worked perfectly, but after pushing many images aren't displayed. Took a hell lot of time to identify it.

@wreeecks
Copy link
Author

@vignesh0025 Thanks for your reply. Yes I'm using windows and the file names are all in lowercase. I've ssh to the server and checked the deployed app /var/lib/openshift/556687fa4382ec952e0000d8/app-root/repo/public. The link is there but I couldn't find the uploaded files. I've search the files in the FS and i couldn't find them.

@wreeecks
Copy link
Author

I'm just wondering, the deployed app is from GIT, then does it mean that anything that's not committed will not be included on the new build? The uploaded files are not supposed to be on GIT right? So what's the best way to handle the files?

@vignesh0025-zz
Copy link
Contributor

of-course it should be committed. use 'git add .' before committing and
everything is done.

On Mon, Oct 26, 2015 at 11:35 AM, Rex notifications@github.com wrote:

I'm just wondering, the deployed app is from GIT, then does it mean that
anything that's not committed will not be included on the new build? The
uploaded files are not supposed to be on GIT right? So what's the best way
to handle the files?


Reply to this email directly or view it on GitHub
#12 (comment).

Vignesh D,
vignesh0025@gmail.com,
Ph:0091 8903128695

@wreeecks
Copy link
Author

@vignesh0025

After 7 hours, I was able to sort it out 🎱

Here's my deploy script . Hope this find helpful to someone.

echo 1>&2
echo "Migrating public uploaded files..." 1>&2
echo 1>&2

if [ ! -d ${OPENSHIFT_DATA_DIR}uploads ]; then
  mv -uf ${OPENSHIFT_REPO_DIR}public/uploads ${OPENSHIFT_DATA_DIR}
fi
if [ ! -d ${OPENSHIFT_DATA_DIR}cards ]; then
  mv -uf ${OPENSHIFT_REPO_DIR}public/cards ${OPENSHIFT_DATA_DIR}cards
fi

echo 1>&2
echo "Deleting existing uploads folder..." 1>&2
echo 1>&2

#delete folders
rm -Rf ${OPENSHIFT_REPO_DIR}public/uploads
rm -Rf ${OPENSHIFT_REPO_DIR}public/cards

echo 1>&2
echo "linking uploads folder..." 1>&2
echo 1>&2

#link upload folders
ln -sf ${OPENSHIFT_DATA_DIR}uploads   ${OPENSHIFT_REPO_DIR}public
ln -sf ${OPENSHIFT_DATA_DIR}cards   ${OPENSHIFT_REPO_DIR}public

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants