The following variables are currently available for use during package building. These are referenced using the {{var}}
syntax. See the implementation in :py~ksconf.package.AppVarMagic
if you'd like to contribute additional variables.
Supported Variables
Variable Source Notes build
app.conf Get build
from[install]
inapp.conf
version
app.conf Get version
from[launcher]
inapp.conf
git_tag
git Run git describe --tags --always --dirty
git_latest_rev
git Run git log -n1 --pretty=format:%h -- .
git_head
git Run git rev-parse --short HEAD
ksconf package -f my_app.tgz MyApp
A more realistic example where the version number in app.conf
is managed by some external process, possibly a tool like bumpversion
.
bumpversion minor
ksconf package -f dist/my_app-{{version}}.tgz MyApp --release-file=.artifact
echo "Build complete, upload $(<.artifact) to SplunkBase"
This will output a message like: Build complete, upload dist/my_app-1.2.3.tgz to SplunkBase
And of course this workflow could be further automated using Splunkbase API calls.
More sophisticated builds can be achieved using the :py~ksconf.builder.core.BuildManager