From 3386df70f8aec7eb59524ccc7e5a9562b620340b Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 10 Sep 2022 19:14:28 -0400 Subject: [PATCH] feat: add ability to override the deploy commit sha This is useful when `bin/ci-pre-deploy` makes changes to the repository --- bin/dokku-deploy | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/dokku-deploy b/bin/dokku-deploy index a204548..7fde85f 100755 --- a/bin/dokku-deploy +++ b/bin/dokku-deploy @@ -86,6 +86,11 @@ if [ -f "bin/ci-pre-deploy" ]; then APP_NAME="$remote_app_name" IS_REVIEW_APP="$is_review_app" SSH_REMOTE="$ssh_remote" bin/ci-pre-deploy fi +if [[ -f ci-commit-override ]]; then + commit_sha="$(cat ci-commit-override)" + log-info "Overriding commit sha with $commit_sha from ci-commit-override" +fi + if [ -n "$DEPLOY_DOCKER_IMAGE" ]; then log-info "Deploying image to Dokku Host" ssh "$ssh_remote" -- git:from-image "$remote_app_name" "$DEPLOY_DOCKER_IMAGE" "$DEPLOY_USER_NAME" "$DEPLOY_USER_EMAIL"