From ca8d1f7f9151b24bfb27ba66c9d44c531b4485f0 Mon Sep 17 00:00:00 2001 From: Jennifer Power Date: Wed, 11 Oct 2023 11:20:51 -0400 Subject: [PATCH] chore: updates entrypoint scripts Signed-off-by: Jennifer Power --- Dockerfile | 1 + actions/autosync/auto-sync-entrypoint.sh | 2 +- actions/rules-transform/rules-transform-entrypoint.sh | 2 +- pyproject.toml | 4 ++-- trestlebot/__main__.py | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7e1958bd..a19bbbd9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -67,6 +67,7 @@ RUN microdnf install -y git \ && microdnf clean all \ && rm -rf /var/lib/apt/lists/* +# Add wrappers for entrypoints that provide support the actions COPY ./actions/autosync/auto-sync-entrypoint.sh / RUN chmod +x /auto-sync-entrypoint.sh diff --git a/actions/autosync/auto-sync-entrypoint.sh b/actions/autosync/auto-sync-entrypoint.sh index 732a183c..48103923 100644 --- a/actions/autosync/auto-sync-entrypoint.sh +++ b/actions/autosync/auto-sync-entrypoint.sh @@ -20,7 +20,7 @@ else fi # Initialize the command variable -command="python3.9 -m trestlebot \ +command="trestlebot-autosync \ --markdown-path=\"${INPUT_MARKDOWN_PATH}\" \ --oscal-model=\"${INPUT_OSCAL_MODEL}\" \ --ssp-index-path=\"${INPUT_SSP_INDEX_PATH}\" \ diff --git a/actions/rules-transform/rules-transform-entrypoint.sh b/actions/rules-transform/rules-transform-entrypoint.sh index 2dc6274e..497cc8ef 100644 --- a/actions/rules-transform/rules-transform-entrypoint.sh +++ b/actions/rules-transform/rules-transform-entrypoint.sh @@ -20,7 +20,7 @@ else fi # Initialize the command variable -command="python3.9 /trestle-bot/trestlebot/entrypoints/rules-tranform.py \ +command="trestlebot-rules-transform \ --rules-view-path=\"${INPUT_RULES_VIEW_PATH}\" \ --commit-message=\"${INPUT_COMMIT_MESSAGE}\" \ --pull-request-title=\"${INPUT_PULL_REQUEST_TITLE}\" \ diff --git a/pyproject.toml b/pyproject.toml index fd932fe5..913aa809 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,8 +16,8 @@ readme = 'README.md' repository = 'https://github.com/RedHatProductSecurity/trestle-bot' [tool.poetry.scripts] -autosync = "trestlebot.entrypoints.autosync:main" -rules-transform = "trestlebot.entrypoints.rule_transform:main" +trestlebot-autosync = "trestlebot.entrypoints.autosync:main" +trestlebot-rules-transform = "trestlebot.entrypoints.rule_transform:main" [tool.poetry.dependencies] python = '^3.8.1' diff --git a/trestlebot/__main__.py b/trestlebot/__main__.py index 2b115f52..a8e9c8d2 100644 --- a/trestlebot/__main__.py +++ b/trestlebot/__main__.py @@ -14,7 +14,7 @@ # License for the specific language governing permissions and limitations # under the License. -# Default entrypoint for trestlebot is autosync mode +# Default entrypoint for trestlebot is autosync mode when run with python -m trestlebot from trestlebot.entrypoints.autosync import main as autosync_main