We’re a few developers working on the same XP site. Since we’ve only just begun developing, we don’t yet have a remote environment - so we’re basically just working locally. Which is fine.
However, we’ve now begun to set up the site with a few pieces of content - some entrances to show on the front page (yey), and now I’d like my fellow developers to have these pieces of content as well.
Now - how do I go about doing this? As far as I can see, I have a few options:
Check in my $XP_HOME to Git, and through this version control all content
Create an import-data–on-startup script, similar to this implementation, and then run an export every time I check in my code to the master branch (that is - available for other developers)
Simply wait until we have a remote environment (i.e. test), and then set up a export-download-import script to sync local content with the remote “master”
What is your preferred way of solving this problem? I would guess the first option is not the preferred one.
In most scenarious, option #3 would be the best approach. You would normally only create test data on your local instances, and then setup the test server with more relevant data. Often one will create content intented for production directly on that server. Importing data from developer nodes is a rare case…
If you checkin content to git, it would definetly not be the $XP_HOME, but rather option #2. Sharing $XP_HOME can be done as regular files, i.e. Google Drive.
We would also recommend you to setup a git repo for XP_HOME config (for all shared environments) + relevant jar files to deploy in each environment (not data). This is how we control Enonic Cloud instances.
We did option 2 in the course tasks. Without a shared test server, that’s what I would do. Remember that it only imports content when the repo is empty, so you can reload the demo content at any time by deleting the site and then restarting the app in the admin console.