Skip to content

Commit

Permalink
Fixes Splunkbase validation errors (#12)
Browse files Browse the repository at this point in the history
Co-authored-by: Mark Kasaboski <[email protected]>
  • Loading branch information
markkasaboski and Mark Kasaboski committed Oct 28, 2024
1 parent bf4a96c commit f9327da
Show file tree
Hide file tree
Showing 30 changed files with 37 additions and 23 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
flare_splunk_integration.tar.gz
venv
venv-tools
flare_splunk_integration/local
flare_splunk_integration/metadata/local.meta
flare/local
flare/metadata/local.meta
__pycache__/
.vscode/

flare_splunk_integration/bin/vendor/*
flare/bin/vendor/*
43 changes: 25 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ build:
venv: requirements.txt
python -m venv venv
venv/bin/pip install --upgrade pip
venv/bin/pip install --target flare_splunk_integration/bin/vendor -r requirements.txt
@find flare_splunk_integration/bin/vendor -type d -name "*.dist-info" -exec rm -r {} +
@find flare_splunk_integration/bin/vendor -type d -name "__pycache__" -exec rm -r {} +
@rm -rf flare_splunk_integration/bin/vendor/bin
@rm -rf flare_splunk_integration/bin/vendor/packaging
@rm -rf flare_splunk_integration/bin/vendor/*-stubs
venv/bin/pip install --target flare/bin/vendor -r requirements.txt
@find flare/bin/vendor -type d -name "*.dist-info" -exec rm -r {} +
@find flare/bin/vendor -type d -name "__pycache__" -exec rm -r {} +
@rm -rf flare/bin/vendor/bin
@rm -rf flare/bin/vendor/packaging
@rm -rf flare/bin/vendor/*-stubs

venv-tools: requirements.tools.txt venv
rm -rf venv-tools
Expand All @@ -24,26 +24,33 @@ clean:
@echo "Removing venv and venv-tools."
@rm -rf venv
@rm -rf venv-tools
@rm -rf flare_splunk_integration/bin/vendor
@unlink "/Applications/Splunk/etc/apps/flare_splunk_integration" || true
@rm -rf flare/bin/vendor
@unlink "/Applications/Splunk/etc/apps/flare" || true
@echo "Done."

.PHONY: package
package:
-@rm flare_splunk_integration.tar.gz
COPYFILE_DISABLE=1 tar --format ustar -cvzf "flare_splunk_integration.tar.gz" "flare_splunk_integration"
package: flare/bin/vendor
-@rm flare.tar.gz
@find flare/bin -type d -name "__pycache__" -exec rm -r {} +
COPYFILE_DISABLE=1 tar \
--exclude='flare/local' \
--exclude='flare/metadata/local.meta' \
--format ustar \
-cvzf \
"flare.tar.gz" \
"flare"

# This will not work until we get an APPID - need to submit in Splunkbase UI first.
.PHONY: publish
publish: flare_splunk_integration.tar.gz
curl -u flaresystems --request POST https://splunkbase.splunk.com/api/v1/app/<APPID>/new_release/ -F "files[]=@./flare_splunk_integration.tar.gz" -F "filename=flare_splunk_integration.tar.gz" -F "cim_versions=4.9,4.7" -F "splunk_versions=9.3" -F "visibility=true"
publish: flare.tar.gz
curl -u flaresystems --request POST https://splunkbase.splunk.com/api/v1/app/<APPID>/new_release/ -F "files[]=@./flare.tar.gz" -F "filename=flare.tar.gz" -F "cim_versions=4.9,4.7" -F "splunk_versions=9.3" -F "visibility=true"

# A manual review from the Splunk team will be required to know if we need to fix any of these tag warnings.
.PHONY: validate
validate: venv-tools
@echo "Running Splunk AppInspect..."
@echo "If you get an error about \"libmagic\", run \"brew install libmagic\""
@venv-tools/bin/splunk-appinspect inspect --ci "flare_splunk_integration" || \
@venv-tools/bin/splunk-appinspect inspect --ci "flare" || \
if test "$$?" -eq "102" || "$$?" -eq "103" ; then \
exit 0 ; \
else \
Expand All @@ -56,7 +63,7 @@ TAGS = advanced_xml alert_actions_conf ast bias cloud csv custom_search_commands
inspect-tags:
@for TAG in $(TAGS); do \
echo "Tag: $$TAG" ; \
venv-tools/bin/splunk-appinspect inspect --ci --included-tags $$TAG "flare_splunk_integration" ; \
venv-tools/bin/splunk-appinspect inspect --ci --included-tags $$TAG "flare" ; \
done

.PHONY: test
Expand All @@ -80,7 +87,7 @@ lint: mypy format-check

.PHONY: mypy
mypy: venv-tools
venv-tools/bin/mypy flare_splunk_integration
venv-tools/bin/mypy flare

.PHONY: splunk-local
splunk-local: venv
Expand All @@ -90,5 +97,5 @@ splunk-local: venv
exit 1; \
fi

@unlink "/Applications/Splunk/etc/apps/flare_splunk_integration" || true
@ln -s "$(CURDIR)/flare_splunk_integration" "/Applications/Splunk/etc/apps/flare_splunk_integration"
@unlink "/Applications/Splunk/etc/apps/flare" || true
@ln -s "$(CURDIR)/flare" "/Applications/Splunk/etc/apps/flare"
Binary file added flare.tar.gz
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
# Splunk app configuration file
#

[author=Flare Systems, Inc.]
email = [email protected]
company = Flare Systems, Inc.

[package]
id = flare

[install]
is_configured = 0

Expand All @@ -13,8 +20,8 @@ supported_themes = light, dark

[launcher]
author = Flare Systems
description =
version = 1.0.1
description = The Flare app allows you to integrate your Flare alerts with the Splunk platform.
version = 0.1.0

[triggers]
reload.flare = simple
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit f9327da

Please sign in to comment.