Sometime ago I blogged about setting up a Splunk app in GitHub with builds and the rest. I just wanted to clean up the inital setup using another tool that is available from Splunk. The Splunk Packaging Toolkit has been around for sometime however now it has been released with recent versions of the Splunk product.
The toolkit provides a number of features, one of which is packaging Splunk apps. Given the previous example on GitHub it is straight forward to setup and I was able to considerably clean up the build script.
Firstly, I moved the source of the app into a sub folder representative of the app folder used for packaging. In this case
Then I created a manifest for the Splunk app via the following command.
slim generate-manifest src/ -o src/octopus_deploy_addon/app.manifest
In terms of the build, not a lot changed other than ensuring the Packaging Toolkit was added before the build started.
Below is a snip from the Travis Build.
language: python sudo: false python: - '2.7' before_install: - wget --output-document splunk-appinspect.tar.gz http://dev.splunk.com/goto/appinspectdownload - pip install splunk-appinspect.tar.gz - pip install http://download.splunk.com/misc/packaging-toolkit/splunk-packaging-toolkit-1.0.0.tar.gz install: - pip install bumpversion script: - "./build.sh"
build.sh file, I was able to focus on the key areas of packaging, testing and pushing a release. The updated build script can be found over at GitHub.
So, try it out and I can assure you packaging Splunk apps has never been easier.