From ac93e1409a60c2ec1e7c8b8d17b460c1dce2921b Mon Sep 17 00:00:00 2001 From: Erick Navarro Date: Tue, 21 May 2024 13:36:54 -0600 Subject: [PATCH] Change entrypoint to use python script instead of bash --- .github/workflows/ci.yml | 14 +++++++------ Dockerfile | 8 +++----- entrypoint.sh | 29 --------------------------- main.py | 43 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 54 insertions(+), 40 deletions(-) delete mode 100755 entrypoint.sh create mode 100755 main.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01c2a95..96bb8eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,4 @@ +--- name: CI on: push @@ -5,12 +6,13 @@ on: push jobs: run-linters: runs-on: ubuntu-latest + container: python:3.12-alpine steps: - name: Check out the repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - name: Install shellcheck - run: sudo apt update && sudo apt install shellcheck --yes - - - name: Run shellcheck - run: shellcheck entrypoint.sh + - name: Run linter and formatter with ruff + run: | + pip install ruff + ruff format --check . + ruff check --output-format github . diff --git a/Dockerfile b/Dockerfile index 7fd0d17..03f6bdb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,5 @@ -FROM alpine:3.19 +FROM python:3.12-alpine -RUN apk --update add curl bash +COPY main.py /main.py -COPY entrypoint.sh /entrypoint.sh - -ENTRYPOINT ["/entrypoint.sh"] +ENTRYPOINT ["/main.py"] diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100755 index 7f91e0c..0000000 --- a/entrypoint.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/bash -l -# exit on any error -set -e - -PROJECT="${INPUT_PROJECT}" -ENVIRONMENT="${INPUT_ENVIRONMENT}" -IMAGE_VERSION="${INPUT_IMAGE_VERSION}" -GITHUB_USERNAME="${GITHUB_ACTOR}" -TOKEN="${INPUT_TOKEN}" -URL="${INPUT_URL}" - -prepare_payload() { - cat <