From 4c257cb1fbabc89b6be5f7d4fff5c65096bd0dd1 Mon Sep 17 00:00:00 2001 From: William P Date: Wed, 3 Sep 2025 13:40:32 -0400 Subject: [PATCH] create kubernetes-job specific service with s3 uploads --- Dockerfile | 2 +- entrypoint-job.sh | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 entrypoint-job.sh diff --git a/Dockerfile b/Dockerfile index 7e2f95a..2cd9e93 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN npm ci COPY tsconfig.json tsconfig.json COPY rollup.config.ts rollup.config.ts -COPY entrypoint.sh entrypoint.sh +COPY entrypoint-job.sh entrypoint.sh COPY src/ src/ RUN npm run build diff --git a/entrypoint-job.sh b/entrypoint-job.sh new file mode 100755 index 0000000..0fa17e2 --- /dev/null +++ b/entrypoint-job.sh @@ -0,0 +1,16 @@ +#!/bin/sh +set -e + +echo "Running zap2xml" +node dist/index.js + +echo "Checking if xmltv file exists" +if test -e "$OUTPUT_FILE"; then + echo "Attempting to upload to S3" + s3cmd put $OUTPUT_FILE "$S3_URL/$PUBLIC_FILENAME" + echo "Setting file to public" + s3cmd setacl "$S3_URL/$PUBLIC_FILENAME" --acl-public +else + echo "File not found, exiting" + exit 1 +fi \ No newline at end of file