diff --git a/.gitignore b/.gitignore index d2b10b8..940ab04 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,5 @@ yarn-error.log licenses.json functional-temp splunktional-temp + +output/ diff --git a/Makefile b/Makefile index 4e623b3..8054c53 100644 --- a/Makefile +++ b/Makefile @@ -32,32 +32,32 @@ clean: rm -rf packages/flare/bin/vendor @unlink "/Applications/Splunk/etc/apps/flare" || true @find . -type d -name "node_modules" -exec rm -rf {} + - rm -rf packages/flare/flare - @rm -f flare.tar.gz + rm -rf output/flare + @rm -f output/flare.tar.gz @echo "Done." .PHONY: package package: packages/flare/bin/vendor - -@rm flare.tar.gz - @find packages/flare/flare/bin -type d -name "__pycache__" -exec rm -r {} + + -@rm -f output/flare.tar.gz + @find output/flare/bin -type d -name "__pycache__" -exec rm -r {} + COPYFILE_DISABLE=1 tar \ - --exclude='packages/flare/flare/local' \ - --exclude='packages/flare/flare/metadata/local.meta' \ + --exclude='output/flare/local' \ + --exclude='output/flare/metadata/local.meta' \ --format ustar \ - -C packages/flare \ + -C output \ -cvzf \ - "flare.tar.gz" \ + "output/flare.tar.gz" \ "flare" .PHONY: publish publish: flare.tar.gz - curl -u "$(SPLUNKBASE_CREDS)" --request POST https://splunkbase.splunk.com/api/v1/app/7602/new_release/ -F "files[]=@./flare.tar.gz" -F "filename=flare.tar.gz" -F "splunk_versions=9.3" -F "visibility=true" + curl -u "$(SPLUNKBASE_CREDS)" --request POST https://splunkbase.splunk.com/api/v1/app/7602/new_release/ -F "files[]=@./output/flare.tar.gz" -F "filename=flare.tar.gz" -F "splunk_versions=9.3" -F "visibility=true" .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 "packages/flare/flare" || \ + @venv-tools/bin/splunk-appinspect inspect --ci "output/flare" || \ if test "$$?" -eq "102" || "$$?" -eq "103" ; then \ exit 0 ; \ else \ @@ -70,7 +70,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 "packages/flare/flare" ; \ + venv-tools/bin/splunk-appinspect inspect --ci --included-tags $$TAG "output/flare" ; \ done .PHONY: test diff --git a/mypy.ini b/mypy.ini index 1489bf8..801a81d 100644 --- a/mypy.ini +++ b/mypy.ini @@ -12,6 +12,6 @@ strict_equality = True disallow_incomplete_defs = True disallow_untyped_defs = True disallow_untyped_calls = True -exclude = (vendor*|flare/flare*)/$ +exclude = (vendor*)/$ follow_imports = skip mypy_path = packages/flare/bin/vendor diff --git a/packages/flare/.gitignore b/packages/flare/.gitignore index cbbe22a..211c1ec 100644 --- a/packages/flare/.gitignore +++ b/packages/flare/.gitignore @@ -1,2 +1 @@ -flare/ !/build.js diff --git a/packages/flare/build.js b/packages/flare/build.js index ed45dd8..b592458 100644 --- a/packages/flare/build.js +++ b/packages/flare/build.js @@ -22,12 +22,12 @@ if (!commands.includes(arg)) { const runCommands = { win32: { build: () => shell.exec('set NODE_ENV=production&&.\\node_modules\\.bin\\webpack --mode=production'), - link: () => shell.exec('mklink /D "%SPLUNK_HOME%\\etc\\apps\\flare" "%cd%\\flare"'), + link: () => shell.exec('mklink /D "%SPLUNK_HOME%\\etc\\apps\\flare" "%cd%\\..\\..\\output\\flare"'), }, nix: { build: () => shell.exec('export NODE_ENV=production && ./node_modules/.bin/webpack --mode=production'), unlink: () => shell.exec('unlink $SPLUNK_HOME/etc/apps/flare || true'), - link: () => shell.exec('ln -s $PWD/flare $SPLUNK_HOME/etc/apps/flare'), + link: () => shell.exec('ln -s $PWD/../../output/flare $SPLUNK_HOME/etc/apps/flare'), }, }; diff --git a/packages/flare/webpack.config.js b/packages/flare/webpack.config.js index 0ad6a0a..f51077d 100644 --- a/packages/flare/webpack.config.js +++ b/packages/flare/webpack.config.js @@ -16,7 +16,7 @@ const entries = fs module.exports = webpackMerge(baseConfig, { entry: entries, output: { - path: path.join(__dirname, 'flare/appserver/static/pages/'), + path: path.join(__dirname, '../../output/flare/appserver/static/pages/'), filename: '[name].js', }, plugins: [ @@ -24,16 +24,16 @@ module.exports = webpackMerge(baseConfig, { patterns: [ { from: path.join(__dirname, 'src/main/resources/splunk'), - to: path.join(__dirname, 'flare'), + to: path.join(__dirname, '../../output/flare'), filter: (filepath) => { return !filepath.endsWith("README/splunk_create.spec.conf"); }, }, { from: path.join(__dirname, 'bin'), - to: path.join(__dirname, 'flare/bin'), + to: path.join(__dirname, '../../output/flare/bin'), }, { from: path.join(__dirname, 'README'), - to: path.join(__dirname, 'flare/'), + to: path.join(__dirname, '../../output/flare/'), }, ], }),