Archive

Is it possible to use Jenkins to automate a Splunk App build?

Explorer

Pretty much just what the title says.

I'm not looking for Jenkins integration. I mean using Jenkins like with any other build process setup, but for a Splunk App.

Right now I'm developing an App but the process for getting new builds is very rough, and I run into issues where I constantly need to make small changes in order to get updates working. If I could automate any of the build process it would be very helpful.

Thanks!

Motivator

Did you manage to get this working or did you end up keeping the "manual" way?

0 Karma

Splunk Employee
Splunk Employee

I don't see why you couldn't. The real question is why? What does the app do? How frequently are you updating or making changes to the app? How many people are contributing to the app? Is the code checked into source control? How much time are you really saving going down this route?

You're introducing a layer of complexity and new tools that you'll need to learn, configure and maintain. This all takes time, resources and energy. I'd bet the amount of time you put into this piece will exceed the amount of time you spend creating new builds by hand. What does your current app release process look like today?

I've built several apps and I just use a local install of Git on my Macbook. I don't have any unit tests or functional testing of the apps. Once I've tested the code and I'm happy with it I just update the version in app.conf and run a simple command.

git archive master --prefix my-app-name/ --format tar | gzip -9 > ../my-app-name_10.tgz

Once it's ready I just hop over to Splunkbase and upload the new version of my app. The whole process is simple and barely takes any time. The upload to Splunkbase and updating any docs is by far the most time consuming part.

Back to your original question. Here are some docs on how to build a Jenkins project and integrate with source control tools.

https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project
https://wiki.jenkins-ci.org/display/JENKINS/Plugins#Plugins-Sourcecodemanagement

A Splunk app in its most basic form is just a compressed directory of dashboards, configs and knowledge objects. My guess is that you'd probably just write a script that compresses your build directory, modifies the version in app.conf and creates the new tgz.

https://wiki.jenkins-ci.org/display/JENKINS/Building+a+software+project#Buildingasoftwareproject-She...

If you get something working you should update the thread and share what you've done in case others want to follow your lead. Good luck!

Explorer

Hi @shaskell,

The reason I'm looking into this is mainly that it will be an official application released by my company, and as such needs to have some kind of testing/building process that can be run as necessary.

Currently I have a process similar to yours where I work out of a local directory with a git master, commit changes, create the tar, and re-upload to Splunk as an upgrade.

However, that process does not always work. It may be the Splunk installation itself, but regardless I'm trying to figure out the best, uniform way to update the app for testing, and then for the real world so that errors can be avoided as much as possible.

Also, in my case, the project will need functionality testing with integration tests and unit tests as it is a release requirement.

I'll explore and definitely update the post if I figure out a solid way.

0 Karma

Explorer

Oh, just in case I didn't clarify enough, this is an App that also includes Python-based scripted inputs. So there needs to be test coverage for them, which would probably need to be run from within the Splunk environment (or at least run using a bash shell script that runs them manually with ./splunk cmd python).

0 Karma