A tool to package up your splunk app and deploy it.
Project description
Splunk app packager
The Splunk app packager runs as a cli tool to package your Splunk app, validate the app, and push it to your Splunk instance.
Install splunk-app-packager
$ pip install splunk-app-packager
Run splunk-app-packager
Set environment variables
$ export SPLUNK_USER=<splunk.com user account>
$ export SPLUNK_PASSWORD=<splunk.com user password>
$ export SPLUNK_ACS_TOKEN=<splunkcloud acs token>
$ export SPLUNK_ACS_STACK=<splunkcloud acs stack name>
Create a config.toml file
Create a package_config section within your config.toml file and set the app name and splunk_user name as shown below:
[package_config]
app = "NAME"
environment = ""
version = ""
splunk_user = "SPLUNK_APP_ACCOUNT"
splunk_app_packager will look for a config.toml file in your current working directory, otherwise you can use the --config-path option to specify it's name and location.
CLI arguments
$ sap --help
Usage: splunk_app_packager [OPTIONS] APP_PACKAGE
Options:
--splunkuser TEXT The splunk.com username. Can also be set via
SPLUNK_USER environment variable [required]
--splunkpassword TEXT The splunk.com password. Can also be set via
SPLUNK_PASSWORD environment variable [required]
--justvalidate Provied a package .tag.gz instead of a directory and
validate it.
--prod Build a PRODUCTION package
--nodeploy Do NOT do the Deploy leg, just validate
--outfile TEXT Provied a package .tag.gz instead of a directory and
validate it.
--acs-stack TEXT The name of the ACS stack. Can also be set via
SPLUNK_ACS_STACK environment variable.
--acs-token TEXT A bearer token for Splunk ACS. Can also be set via
SPLUNK_ACS_TOKEN environment variable.
--config-path TEXT A path to the config.toml file. [required]
--help Show this message and exit.
Example usage
$ sap /path/to/app/folder --prod
Use as GitHub Action
Example production deployment
name: Production Deployment
on:
push:
branches:
- main
paths:
- APP_NAME/**
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dfe-digital/splunk-app-packager@v0.0.2
with:
app_package_path: 'APP_NAME'
splunk_username: ${{ secrets.SPLUNK_USERNAME }}
splunk_password: ${{ secrets.SPLUNK_PASSWORD }}
splunk_acs_token: ${{ secrets.SPLUNK_ACS_TOKEN }}
splunk_acs_stack: ${{ secrets.SPLUNK_ACS_STACK }}
Example with a different path for config.toml
name: Production Deployment
on:
push:
branches:
- main
paths:
- APP_NAME/**
workflow_dispatch:
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dfe-digital/splunk-app-packager@v0.0.2
with:
app_package_path: 'APP_NAME'
splunk_username: ${{ secrets.SPLUNK_USERNAME }}
splunk_password: ${{ secrets.SPLUNK_PASSWORD }}
splunk_acs_token: ${{ secrets.SPLUNK_ACS_TOKEN }}
splunk_acs_stack: ${{ secrets.SPLUNK_ACS_STACK }}
config_toml_path: 'conf/config.toml'
Contributing
Refer to our contributing guidelines if you'd like to raise a bug or pull request.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file splunk_app_packager-0.0.3.tar.gz.
File metadata
- Download URL: splunk_app_packager-0.0.3.tar.gz
- Upload date:
- Size: 9.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1ec206689592946596631c549e49e9e2da96a7d4eb7a1acfb33b37d9e45198b
|
|
| MD5 |
d9f1cae84fd6dc7c6c0cfc9e0d82d64d
|
|
| BLAKE2b-256 |
592caf8fbeb33d0f6ff825f0f26b881eb457cd1801de7dceef155366b18e259f
|
Provenance
The following attestation bundles were made for splunk_app_packager-0.0.3.tar.gz:
Publisher:
release.yml on DFE-Digital/splunk-app-packager
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
splunk_app_packager-0.0.3.tar.gz -
Subject digest:
d1ec206689592946596631c549e49e9e2da96a7d4eb7a1acfb33b37d9e45198b - Sigstore transparency entry: 148865213
- Sigstore integration time:
-
Permalink:
DFE-Digital/splunk-app-packager@d9f47161db63dffafcaab4bc20e96fed26e4470a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/DFE-Digital
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d9f47161db63dffafcaab4bc20e96fed26e4470a -
Trigger Event:
push
-
Statement type:
File details
Details for the file splunk_app_packager-0.0.3-py3-none-any.whl.
File metadata
- Download URL: splunk_app_packager-0.0.3-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
575ec38ef9c9b16a181188597a1b8db9b52486532ef343a38e249c592be8c2dc
|
|
| MD5 |
54bb14b6d586e57e33c29f5cc99e874d
|
|
| BLAKE2b-256 |
45338ceadb9375cc72be559c5476bc1149d9cba5fddd8e5fe1f5f272f38d87b0
|
Provenance
The following attestation bundles were made for splunk_app_packager-0.0.3-py3-none-any.whl:
Publisher:
release.yml on DFE-Digital/splunk-app-packager
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
splunk_app_packager-0.0.3-py3-none-any.whl -
Subject digest:
575ec38ef9c9b16a181188597a1b8db9b52486532ef343a38e249c592be8c2dc - Sigstore transparency entry: 148865216
- Sigstore integration time:
-
Permalink:
DFE-Digital/splunk-app-packager@d9f47161db63dffafcaab4bc20e96fed26e4470a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/DFE-Digital
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@d9f47161db63dffafcaab4bc20e96fed26e4470a -
Trigger Event:
push
-
Statement type: