From e019650fcca3293a95298faa0243b0144a7bf7c4 Mon Sep 17 00:00:00 2001 From: Carlos Fontes Date: Wed, 16 Aug 2023 12:54:19 +0000 Subject: [PATCH] fix --- .../{test-e2e-bb.yml => test-bb.yml} | 4 +-- script/bb | 25 +++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) rename .github/workflows/{test-e2e-bb.yml => test-bb.yml} (90%) create mode 100755 script/bb diff --git a/.github/workflows/test-e2e-bb.yml b/.github/workflows/test-bb.yml similarity index 90% rename from .github/workflows/test-e2e-bb.yml rename to .github/workflows/test-bb.yml index d05a44e..ccafff2 100644 --- a/.github/workflows/test-e2e-bb.yml +++ b/.github/workflows/test-bb.yml @@ -18,9 +18,9 @@ jobs: with: ref: ${{ github.head_ref || github.ref_name }} - name: Run Babashka unit and integration tests - run: bb run test-bb + run: script/bb run test-bb - name: Create POM file for bb e2e tests run: lein pom - name: Run Babashka e2e tests working-directory: ${{ github.workspace }}/test/e2e/bb - run: bb test.clj + run: script/bb test.clj diff --git a/script/bb b/script/bb new file mode 100755 index 0000000..a17a917 --- /dev/null +++ b/script/bb @@ -0,0 +1,25 @@ +#!/bin/sh + +# source: https://jmglov.net/blog/2022-08-09-dogfooding-blambda-2.html + +set -e + +export BABASHKA_DISABLE_SIGNAL_HANDLERS="true" + +export XDG_CACHE_HOME=/opt +export XDG_CONFIG_HOME=/opt +export XDG_DATA_HOME=/opt +export HOME=/var/task +export GITLIBS=/opt +export CLOJURE_TOOLS_DIR=/opt +export CLJ_CACHE=/opt +export CLJ_CONFIG=/opt + +export BABASHKA_CLASSPATH="/opt/.m2:var/task/src:/var/task/.m2:/var/task:/var/task/src/clj:/var/task/src/cljc:src/cljc:src/clj:/var/task/resources" +export BABASHKA_PRELOADS='(load-file "/opt/hacks.clj")' + +if [ -z "$HL_ENTRYPOINT" ]; then + echo "Environment variable \"HL_ENTRYPOINT\" is not set. See https://fierycod.github.io/holy-lambda/#/babashka-backend-tutorial" +fi; + +bb -Duser.home=/var/task -m "$HL_ENTRYPOINT"