Skip to content

Latest commit

 

History

History
60 lines (37 loc) · 1.86 KB

cmd_package.rst

File metadata and controls

60 lines (37 loc) · 1.86 KB

ksconf package

Variables

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] in app.conf
version app.conf Get version from [launcher] in app.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

Example

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.

See also

More sophisticated builds can be achieved using the :py~ksconf.builder.core.BuildManager