From dfaf030d19ed8f6d8d3339c9a18736fcc8306d9e Mon Sep 17 00:00:00 2001 From: lvoloshyn-sekoia Date: Wed, 29 May 2024 18:00:05 +0300 Subject: [PATCH 1/5] Improve module creation script --- .../scripts/new_module/template/hooks/post_gen_project.sh | 1 + .../template/{{cookiecutter.module_dir}}/CHANGELOG.md | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 100644 sekoia_automation/scripts/new_module/template/{{cookiecutter.module_dir}}/CHANGELOG.md diff --git a/sekoia_automation/scripts/new_module/template/hooks/post_gen_project.sh b/sekoia_automation/scripts/new_module/template/hooks/post_gen_project.sh index 0972045..f487834 100644 --- a/sekoia_automation/scripts/new_module/template/hooks/post_gen_project.sh +++ b/sekoia_automation/scripts/new_module/template/hooks/post_gen_project.sh @@ -1,2 +1,3 @@ #!/bin/bash +poetry add sekoia-automation-sdk@latest poetry lock \ No newline at end of file diff --git a/sekoia_automation/scripts/new_module/template/{{cookiecutter.module_dir}}/CHANGELOG.md b/sekoia_automation/scripts/new_module/template/{{cookiecutter.module_dir}}/CHANGELOG.md new file mode 100644 index 0000000..11bddf3 --- /dev/null +++ b/sekoia_automation/scripts/new_module/template/{{cookiecutter.module_dir}}/CHANGELOG.md @@ -0,0 +1,8 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] From cb1f42be60c55c35df3c38ef3430391af91c6a13 Mon Sep 17 00:00:00 2001 From: lvoloshyn-sekoia Date: Thu, 30 May 2024 12:19:53 +0300 Subject: [PATCH 2/5] Fix version --- .../template/{{cookiecutter.module_dir}}/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sekoia_automation/scripts/new_module/template/{{cookiecutter.module_dir}}/manifest.json b/sekoia_automation/scripts/new_module/template/{{cookiecutter.module_dir}}/manifest.json index 3b96f0b..16dc6e5 100644 --- a/sekoia_automation/scripts/new_module/template/{{cookiecutter.module_dir}}/manifest.json +++ b/sekoia_automation/scripts/new_module/template/{{cookiecutter.module_dir}}/manifest.json @@ -10,5 +10,5 @@ "name": "{{cookiecutter.module_name}}", "uuid": "{{ uuid4() }}", "docker": "sekoia-automation-module-{{cookiecutter.module_name.lower()}}", - "version": "1.0" + "version": "0.1.0" } From 93ee8e9288a456974de839fcaa28c815688a345a Mon Sep 17 00:00:00 2001 From: lvoloshyn-sekoia Date: Wed, 5 Jun 2024 13:35:03 +0300 Subject: [PATCH 3/5] Improve conftest --- .../template/{{cookiecutter.module_dir}}/tests/conftest.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sekoia_automation/scripts/new_module/template/{{cookiecutter.module_dir}}/tests/conftest.py b/sekoia_automation/scripts/new_module/template/{{cookiecutter.module_dir}}/tests/conftest.py index b4612d9..e236460 100644 --- a/sekoia_automation/scripts/new_module/template/{{cookiecutter.module_dir}}/tests/conftest.py +++ b/sekoia_automation/scripts/new_module/template/{{cookiecutter.module_dir}}/tests/conftest.py @@ -2,16 +2,15 @@ from tempfile import mkdtemp import pytest - from sekoia_automation import constants @pytest.fixture -def symphony_storage(): +def data_storage(): original_storage = constants.DATA_STORAGE constants.DATA_STORAGE = mkdtemp() yield constants.DATA_STORAGE rmtree(constants.DATA_STORAGE) - constants.SYMPHONY_STORAGE = original_storage + constants.DATA_STORAGE = original_storage From 83d8d63fd544bcb254190680d74486fe21d38f2c Mon Sep 17 00:00:00 2001 From: lvoloshyn-sekoia Date: Wed, 5 Jun 2024 13:35:44 +0300 Subject: [PATCH 4/5] Upgrade default python version --- .../new_module/template/{{cookiecutter.module_dir}}/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sekoia_automation/scripts/new_module/template/{{cookiecutter.module_dir}}/Dockerfile b/sekoia_automation/scripts/new_module/template/{{cookiecutter.module_dir}}/Dockerfile index a326133..411dd17 100644 --- a/sekoia_automation/scripts/new_module/template/{{cookiecutter.module_dir}}/Dockerfile +++ b/sekoia_automation/scripts/new_module/template/{{cookiecutter.module_dir}}/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.10 +FROM python:3.11 WORKDIR /app From 1da98b78199cffe930de86ddd515e1adf6b86b52 Mon Sep 17 00:00:00 2001 From: lvoloshyn-sekoia Date: Wed, 12 Jun 2024 12:48:26 +0300 Subject: [PATCH 5/5] Remove docker arg from manifest --- .../template/{{cookiecutter.module_dir}}/manifest.json | 1 - 1 file changed, 1 deletion(-) diff --git a/sekoia_automation/scripts/new_module/template/{{cookiecutter.module_dir}}/manifest.json b/sekoia_automation/scripts/new_module/template/{{cookiecutter.module_dir}}/manifest.json index 16dc6e5..c501297 100644 --- a/sekoia_automation/scripts/new_module/template/{{cookiecutter.module_dir}}/manifest.json +++ b/sekoia_automation/scripts/new_module/template/{{cookiecutter.module_dir}}/manifest.json @@ -9,6 +9,5 @@ "description": "{{cookiecutter.module_description}}", "name": "{{cookiecutter.module_name}}", "uuid": "{{ uuid4() }}", - "docker": "sekoia-automation-module-{{cookiecutter.module_name.lower()}}", "version": "0.1.0" }