What is the correct method of deploying vanilla to the cloud?
Greetings Vanilla Community.
Ok, I'll elaborate my situation a bit.
I'm trying to set up a test deployment of vanilla forum on a openshift cartridge. I build from the vanilla repo (cloned from github master) locally using phing and deploy the built package inside the './build' directory to openshift using 'git push'. Then openshift deployes the code from the repo. After that is done, I can access the web installation script of vanilla to configure my installation.
But, the problem is if I update something locally in the build package (in './build/package' directory), take for example add some extrnal plugins, themes etc. and push the changes back to openshift, then openshift ~~~~re-deployes vanilla and I'm forced to run the web installation script again. But, as the database is already existing on the server, the installation script creates duplicate entries. I also noticed that I lost my addon configurations.
So it makes me think that this is not the correct way of deploying vanilla forum on the cloud. I'm totally new to this cloud thing, btw. It will be great if someone can point me to the right method of deploying vanilla forum on the cloud so that I don't lose my configurations every time I make minor changes in my application locally and I don't have to run the installation script again and again after every git push to openshift.
Thank you.
Best Answers
-
Linc Admin
Our automated deploy for a new site is more along the lines of:
- Deploy the latest code.
- Deploy a default, pre-made
conf/config.php
. - Run utility/update.
This bypasses ever using the installer.
If you are having issues where the installer is showing up on an already-installed forum, it indicates your deploy is possibly deleting the entire
conf
folder.3 -
hgtonight MVP
@cinom said:
Now, do I have to preserve the entireconf
directory throughout deployments or is it only theconf/config.php
file?config.php
is the only file generated in that directory. You may have other files you want to put in there (locale.php, bootstrap.php, etc)And what is
utility/update
? Is it a script provided with vanilla? But, I don't see any directory calledutility
under application root. Maybe I'm getting it wrong?Vanilla uses a dispatcher to load the right controller and execute the right method. There is no directory called 'discussion', but here we are in https://vanillaforums.org/discussion/32121/what-is-the-correct-method-of-deploying-vanilla-to-the-cloud.
The utility/update is calling the update method of the utility controller which is part of the dashboard application. You can see what is being executed in
/applications/dashboard/controllers/class.utilitycontroller.php
and looking forpublic function structure
.If I want to move the
conf
directory out of the project root, how do I do that?
Say for example, if my current directory structure is something likehome │ └───app-root │ ├───vanilla-repo │ │ ... │ │ .... │ │ index.php │ │ │ ├───conf │ │ │ ... │ │ │ config.php │ │ │ │ │ │ └───data
and I want it to become,
home │ └───app-root │ ├───vanilla-repo │ │ ... │ │ .... │ │ index.php │ │ │ └───data │ ... │ └───conf │ ... │ config.php │
how do I do that?
Basically, is there any standardized way of doing this? I think I'll also have to change the location of theuploads
directory to reside outside project root.You can change the
PATH_CONF
via a/conf/bootstrap.before.php
file:<?php define('PATH_CONF', PATH_ROOT.'/conf'); // change to be whatever you want
Now that you have changed where the
/conf
directory lies, you can change any of the other PATH constants via the/new_conf_dir/constants.php
file, although you are most interested inPATH_UPLOADS
.Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
4
Answers
Are you deploying the master branch? That is not suggested for production. I would use the
release/2.2
branch.Either way, sounds like your
/conf/config.php
file is getting clobbered in the push. I have no idea how to troubleshoot this as I have no experience with openshift.Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Our automated deploy for a new site is more along the lines of:
conf/config.php
.This bypasses ever using the installer.
If you are having issues where the installer is showing up on an already-installed forum, it indicates your deploy is possibly deleting the entire
conf
folder.Thank you both for your replies. I'll try to implement the method Linc has shown.
As I understand, openshift actually re-creates the entire deployment from scratch every time I push the local modifications to the repo. Nothing from the previous deployment is reused unless I keep it in the
app-root/data
directory; as can be seen here in the 'data' section. So yeah, every time I deploy my code through agit push
, the entire content of theconf
folder is getting recreated.Now, do I have to preserve the entire
conf
directory throughout deployments or is it only theconf/config.php
file?And what is
utility/update
? Is it a script provided with vanilla? But, I don't see any directory calledutility
under application root. Maybe I'm getting it wrong?If I want to move the
conf
directory out of the project root, how do I do that?Say for example, if my current directory structure is something like
and I want it to become,
how do I do that?
Basically, is there any standardized way of doing this? I think I'll also have to change the location of the
uploads
directory to reside outside project root.config.php
is the only file generated in that directory. You may have other files you want to put in there (locale.php, bootstrap.php, etc)Vanilla uses a dispatcher to load the right controller and execute the right method. There is no directory called 'discussion', but here we are in https://vanillaforums.org/discussion/32121/what-is-the-correct-method-of-deploying-vanilla-to-the-cloud.
The utility/update is calling the update method of the utility controller which is part of the dashboard application. You can see what is being executed in
/applications/dashboard/controllers/class.utilitycontroller.php
and looking forpublic function structure
.You can change the
PATH_CONF
via a/conf/bootstrap.before.php
file:Now that you have changed where the
/conf
directory lies, you can change any of the other PATH constants via the/new_conf_dir/constants.php
file, although you are most interested inPATH_UPLOADS
.Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
I see, it never occurred to me that Linc was actually talking about a url! That clarifies it.
Anyways, thanks again @hgtonight. I'll try to update this thread later based on how the things work out for me.