Search
  • Juan Ayala

Syncing Files With Repo Tool

While developing custom solutions for AEM, files are synced with the JCR and tested oh... several hundred times a day! JSP, HTL, XML or JSON. Over the years there has been a lot of plugins and tools dedicated to this. The newest tool is the simplest.


The Repo tool from Adobe is a simple ~750 line script file. It does not use anything more than basic unix tools. Zip, unzip, curl, rsync and mktemp.


Installing on Mac

If you are on a Mac this is simple. Using Homebrew tap the adobe-marketing-cloud/brews repository and install the repo formula.

If you are on Windows, it is a little more tricky. Take a look at the README section about Windows. You will need Cygwin. In theory any Unix shell on Windows could work. And if you are looking for a weekend project, you might want to port over the repo script to PowerShell.


Command Line

The repo tool has 5 basic operations. Checkout, put, get, status and diff. Run the help command repo --help to get the list of operations along with other useful information.

As you'll see, you can use a .repo file to configure the server and credentials. However I will use the command line flags -s and -u that are more flexible when integrating with IntelliJ.


Integrating With IntelliJ

My IDE of choice is IntelliJ. The instructions on how to integrate repo tool with it are found here. There are instructions for Eclipse and Visual Studio Code.


For IntelliJ, the first thing you have to do is set up an external tool. Go to Preferences > Tools > External Tools. Here I will set up one entry for each operation, both for author and publish. On the publish entries, I add the this to the arguments -s http://localhost:4503.

Once I have the external tool setup you will find them when you right click on a file.

This is not really convenient. To speed things up you can add key bindings. Open Preferences > Keymap. There you will find your external tool group with all the entries. You can specify one key binding for each.

As you can see I use ⌥A for Author, or ⌥P for Publisher, followed by the letter for the command. P for put, G for get and so on.


Conclusion

Repo tool is much simpler than the other solutions that have sprouted up during the years. For example I used the Brackets extension up until a couple of years ago. Then I switched to aemsync. But that needs Node which makes it a little inconvenient. Finally I've been using repo tool these last couple of years. It is simple and it works. You can sync one file, or an entire directory.

311 views0 comments

Recent Posts

See All