Skip to content
This repository was archived by the owner on Jul 27, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
venv
.venv
.env
.*.sw*
__pycache__
Expand Down
9 changes: 7 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@ pipeline {
APPVERSION = "1.0.${BUILD_NUMBER}"
}
stages {
stage('setup') {
steps {
sh 'curl -LsSf https://astral.sh/uv/install.sh | sh'
}
}
stage('build') {
steps {
sh 'make'
sh 'export PATH="$HOME/.local/bin:$PATH" && make'
}
}
stage('validate') {
steps {
withCredentials([usernamePassword(credentialsId: 'splunkbase', passwordVariable: 'SPLUNK_PASS', usernameVariable: 'SPLUNK_USER')]) {
sh 'make validate'
sh 'export PATH="$HOME/.local/bin:$PATH" && make validate'
}
}
post {
Expand Down
18 changes: 5 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ LOOKUPDIR = $(SRCDIR)/lookups
endif

BUILD = build
VENV = venv

VENV_BIN=$(VENV)/bin
PYTHON=$(VENV_BIN)/python
SYS_PYTHON = $(or $(shell which python3), $(shell which python))

TAR = $(shell which tar)
RM = $(shell which rm)
Expand Down Expand Up @@ -79,11 +74,8 @@ all: $(ARTIFACTS)

## Environment setup

$(VENV)/pyvenv.cfg:
$(SYS_PYTHON) -m venv $(VENV)

deps: $(VENV)/pyvenv.cfg
$(PYTHON) -m pip install -r requirements.txt
deps:
uv sync

.PHONY: deps

Expand All @@ -102,7 +94,7 @@ $(LOOKUPS): $(BUILD)/lookups
$(CP) $@ $(BUILD)/lookups/

$(APPCONF): deps $(BUILD) $(LOOKUPS)
$(PYTHON) generate.py -t $(APPSKEL) -v $(VERSION) -n $(APPNAME) -b $(BUILD) $(SRCDIR)
uv run python generate.py -t $(APPSKEL) -v $(VERSION) -n $(APPNAME) -b $(BUILD) $(SRCDIR)

$(PACKAGE): $(APPCONF)
$(TAR) -zcf $(PACKAGE) $(TARFLAGS) $(BUILD)
Expand All @@ -112,7 +104,7 @@ $(PACKAGE): $(APPCONF)
check: lint

lint: deps
$(VENV_BIN)/yamllint $(SRCDIR)
uv run yamllint $(SRCDIR)

.PHONY: check lint

Expand All @@ -131,6 +123,6 @@ endif
## Clean

clean:
$(RM) -rf $(ARTIFACTS) $(VENV) $(BUILD)
$(RM) -rf $(ARTIFACTS) $(BUILD) .venv

.PHONY: clean
18 changes: 18 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[project]
name = "krang"
version = "1.0.0"
description = "Knowledge, Reports, Alerts & Normalization Generator for Splunk"
readme = "README.md"
license = "Apache-2.0"
requires-python = ">=3.10"
dependencies = [
"pyyaml>=6.0",
"yamllint>=1.28",
]

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.hatch.build.targets.wheel]
packages = ["lib/splunkgen"]
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

Loading