Sharing content between developers

Enonic version: XP (6.1)
OS: Mac OSX

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:

  1. Check in my $XP_HOME to Git, and through this version control all content
  2. 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)
  3. 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.

1 Like

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.

1 Like

We also struggled with Who has What content and data. And I have some tips for working as a team that we use.

  1. One developer should setup the project and checks it into GIT.
  2. Early as possible get a server to test on. Its cheap to rent and Enonic XP is easy to setup.
  3. Use Continous Integration with build and for best practice tests from the DEV/MASTER branch on the server.
  4. Create a GIT repo for the application and use Git Workflow every developer works on they’re own branch and use pull requests into MASTER/DEV branch.
  5. Export data from repo on server to its own GIT repo. Create export cron job for data in repo -> push to git as often that you need.
  6. DEVs are always responsible to have no breakable code and add the setup for new functionality on the test server.

We are small team so this works for us

//runar