From bcd6e4f58a4ed31226658b6ad383de9072ffd158 Mon Sep 17 00:00:00 2001 From: David Zhang Date: Thu, 26 Jun 2025 12:26:18 -0400 Subject: [PATCH 1/2] adding commit sha to deploy command in entrypoint.sh --- entrypoint.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 33361ee..2fa4688 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -64,7 +64,13 @@ deploy_resource() { # This specificity ensures that we avoid deploying when only the components subdir has changes. if echo "$changed_files" | grep -qP "${escaped_location}/((application|page|api).yaml|.*\.js|.*\.py|apis/|pages/)" ; then printf "\nChange detected. Deploying...\n" - superblocks deploy "$location" + if [ -n "$SUPERBLOCKS_COMMIT_SHA" -a "$SUPERBLOCKS_COMMIT_SHA" != "HEAD" ]; then + printf "\nDeploying with deploy command: superblocks deploy $location --commit-id $SUPERBLOCKS_COMMIT_SHA\n" + superblocks deploy "$location" --commit-id "$SUPERBLOCKS_COMMIT_SHA" + else + printf "\nDeploying with deploy command: superblocks deploy $location\n" + superblocks deploy "$location" + fi else printf "\nNo change detected. Skipping deploy...\n" fi From ed5359c28a84c2dcb512f82283a998d16b6509fc Mon Sep 17 00:00:00 2001 From: David Zhang Date: Thu, 26 Jun 2025 12:53:20 -0400 Subject: [PATCH 2/2] use new && format --- entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index 2fa4688..5efa6b9 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -64,7 +64,7 @@ deploy_resource() { # This specificity ensures that we avoid deploying when only the components subdir has changes. if echo "$changed_files" | grep -qP "${escaped_location}/((application|page|api).yaml|.*\.js|.*\.py|apis/|pages/)" ; then printf "\nChange detected. Deploying...\n" - if [ -n "$SUPERBLOCKS_COMMIT_SHA" -a "$SUPERBLOCKS_COMMIT_SHA" != "HEAD" ]; then + if [ -n "$SUPERBLOCKS_COMMIT_SHA" ] && [ "$SUPERBLOCKS_COMMIT_SHA" != "HEAD" ]; then printf "\nDeploying with deploy command: superblocks deploy $location --commit-id $SUPERBLOCKS_COMMIT_SHA\n" superblocks deploy "$location" --commit-id "$SUPERBLOCKS_COMMIT_SHA" else