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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...