Deployment Architecture

Using Splunk with GIT source control, is there a way to ignore the .git directory of our app when pushing changes using a deployer?

greenwayb
Explorer

Hi

We are using Git for our source management that works like this. A Dev search head exists, reports/searches dashboards are created and modified. This is all wrapped into an app. That app is source controlled via git and pushed to a central server.

We previously deployed the app using techniques involving the Deployment Server or the Master Node but we have now moved to the deployer

We checked out our git app, but this creates a residual .git directory. When pushing out changes using the deployer it complains (about the .git directory).

Error while deploying apps to first member: ConfDeploymentException: Error while updating app=.git 
{"messages":[{"type":"ERROR","text":"Application does not exist: .git"}]}/opt/splunk/etc/shcluster/apps

Is there a way to ignore this .git directory?

1 Solution

dwaddle
SplunkTrust
SplunkTrust

This has come up before in a few cases. Splunk has treated this type of thing as a defect before and added code to ignore .svn, .git, and .hg directories in various contexts. Perhaps deployer needs this too.

Alternately, http://stackoverflow.com/questions/3913736/git-repository-with-git-directory-stored-elsewhere discussed the use of a .git FILE (not directory) that specifies an alternate location of the normal .git repository tree. This might be enough to "fool" deployer.

View solution in original post

dustinhartje
Explorer

I ran into this error in 6.3 also and was able to get this working by including everything under /opt/splunk/etc/shcluster in my repo rather than just the contents of the apps subfolder.

So on my deployer it looks like:

/opt/splunk/etc/shcluster
/opt/splunk/etc/shcluster/.git
/opt/splunk/etc/shcluster/apps
/opt/splunk/etc/shcluster/users

0 Karma

dwaddle
SplunkTrust
SplunkTrust

This has come up before in a few cases. Splunk has treated this type of thing as a defect before and added code to ignore .svn, .git, and .hg directories in various contexts. Perhaps deployer needs this too.

Alternately, http://stackoverflow.com/questions/3913736/git-repository-with-git-directory-stored-elsewhere discussed the use of a .git FILE (not directory) that specifies an alternate location of the normal .git repository tree. This might be enough to "fool" deployer.

greenwayb
Explorer

Thanks. Yes would be best easiest for splunk to ignore the .git directory - is there a way to raise this as a request for future versions? (Must be why it worked with the Deployment Server / Master Server)

Thanks also for the approach on storing a git directory elsewhere, that is something i wasnt aware of.

I am still thinking will try symlink (handy part about being on unix) but good to have options. Thanks.

0 Karma

greenwayb
Explorer

The symlink approach seems to have worked for what we needed. Created a separate directory, VCS (Version Control System) and symlinked it into the shcluster/apps

0 Karma

greenwayb
Explorer

Error while deploying apps to first member: ConfDeploymentException: Error while updating app=.git
{"messages":[{"type":"ERROR","text":"Application does not exist: .git"}]}
/opt/splunk/etc/shcluster/apps

0 Karma

kylekoza
Explorer

I submitted a support case for this problem. Hopefully, this will get fixed.

0 Karma

Jeremiah
Motivator

Have you heard anything back from Splunk? I haven't seen any mention of this issue getting resolved in the release notes, but I haven't yet tried it with 6.3.2 either.

0 Karma

jplumsdaine22
Influencer

bump - surely Splunk have fixed this by now?

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...