Skip to content

Add ability for src-expose to periodically run a command (without then running git commit)

Created by: dadlerj

Requested by https://app.hubspot.com/contacts/2762526/company/768958891

Context: https://github.com/sourcegraph/sourcegraph/pull/9246#issuecomment-603288802

More context from a discussion when a user learned about src-expose for the first time:

Me:

Your understanding of what has to happen (pull down a tree, run git pull periodically) is mostly correct, but the final step is to serve the directories up over HTTP so that Sourcegraph can access them. This is the part that src-expose takes care of for you.

Them:

Sure. I understand that, I guess what I was really asking is "does your container take care of periodically running git update on a git directory I give it? or does it just do the last step"

I mean ideally I would hope for docker run -v /repo:/path/to/repo/on/host -e INTERVAL:300 src-expose or something similar

Atleast thats what I am planning on creating

This feels like the most useful way to use src-expose today (based on feedback from a handful of companies). They want to use some periodic syncing command that syncs changes as git commits in the repo, and then simply serves it.

The extra step in our current default src-expose dir behavior of squashing all changes and committing them (and causing the Git history to be lost) is only useful in specific circumstances, and likely wouldn't be a common use case for our customers today.