From c8eef60b096e98eeafab25b9c47cd72918123181 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 10 Sep 2022 18:56:55 -0400 Subject: [PATCH 1/5] test: ensure test runs against vendored app-nginx.conf.sigil and mime.types --- bin/ci-pre-deploy | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/bin/ci-pre-deploy b/bin/ci-pre-deploy index 08b7600..03a04b7 100644 --- a/bin/ci-pre-deploy +++ b/bin/ci-pre-deploy @@ -1,15 +1,26 @@ #!/bin/sh -l if [ "$IS_REVIEW_APP" = "true" ]; then + git config --global user.name 'Dokku Bot' + git config --global user.email no-reply@dokku.com + echo "-----> Purging repo cache" ssh "$SSH_REMOTE" -- repo:purge-cache "$APP_NAME" echo "-----> Setting the test domain name" ssh "$SSH_REMOTE" -- domains:set "$APP_NAME" "$APP_NAME.dokku.net" + echo "-----> Ensure test includes vendored app-nginx.conf.sigil" + cp conf/app-nginx.conf.sigil app-nginx.conf.sigil + git add app-nginx.conf.sigil + git commit -qm "feat: specify custom app-nginx.conf.sigil" + + echo "-----> Ensure test includes vendored mime.types" + cp conf/mime.types mime.types + git add mime.types + git commit -qm "feat: specify custom mime.types" + echo "-----> Setting the buildpack to the current commit" echo "https://github.com/${GITHUB_REPOSITORY}.git#$GITHUB_SHA" > .buildpacks git add .buildpacks - git config --global user.name 'Dokku Bot' - git config --global user.email no-reply@dokku.com git commit -qm "feat: specify $GITHUB_SHA as buildpack" fi \ No newline at end of file From 53b41ec631acec1f5ded5275faa17ce95ba3f618 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 10 Sep 2022 19:58:50 -0400 Subject: [PATCH 2/5] fix: override commit being deployed --- bin/ci-pre-deploy | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/ci-pre-deploy b/bin/ci-pre-deploy index 03a04b7..8988f28 100644 --- a/bin/ci-pre-deploy +++ b/bin/ci-pre-deploy @@ -23,4 +23,6 @@ if [ "$IS_REVIEW_APP" = "true" ]; then echo "https://github.com/${GITHUB_REPOSITORY}.git#$GITHUB_SHA" > .buildpacks git add .buildpacks git commit -qm "feat: specify $GITHUB_SHA as buildpack" + + git rev-parse HEAD >ci-commit-override fi \ No newline at end of file From a11d1ce3036d021df4eaf069afecff5bbb944824 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 10 Sep 2022 20:11:49 -0400 Subject: [PATCH 3/5] refactor: use ref name instead of sha --- bin/ci-pre-deploy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/ci-pre-deploy b/bin/ci-pre-deploy index 8988f28..9040efb 100644 --- a/bin/ci-pre-deploy +++ b/bin/ci-pre-deploy @@ -19,8 +19,8 @@ if [ "$IS_REVIEW_APP" = "true" ]; then git add mime.types git commit -qm "feat: specify custom mime.types" - echo "-----> Setting the buildpack to the current commit" - echo "https://github.com/${GITHUB_REPOSITORY}.git#$GITHUB_SHA" > .buildpacks + echo "-----> Setting the buildpack to the current ref $GITHUB_REF_NAME" + echo "https://github.com/${GITHUB_REPOSITORY}.git#$GITHUB_REF_NAME" > .buildpacks git add .buildpacks git commit -qm "feat: specify $GITHUB_SHA as buildpack" From 7154c020a1ccb6fcf14fa248a91c018401d75d8a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 10 Sep 2022 20:14:49 -0400 Subject: [PATCH 4/5] fix: use GITHUB_HEAD_REF instead --- bin/ci-pre-deploy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/ci-pre-deploy b/bin/ci-pre-deploy index 9040efb..3f46867 100644 --- a/bin/ci-pre-deploy +++ b/bin/ci-pre-deploy @@ -19,8 +19,8 @@ if [ "$IS_REVIEW_APP" = "true" ]; then git add mime.types git commit -qm "feat: specify custom mime.types" - echo "-----> Setting the buildpack to the current ref $GITHUB_REF_NAME" - echo "https://github.com/${GITHUB_REPOSITORY}.git#$GITHUB_REF_NAME" > .buildpacks + echo "-----> Setting the buildpack to the current ref $GITHUB_HEAD_REF" + echo "https://github.com/${GITHUB_REPOSITORY}.git#$GITHUB_HEAD_REF" > .buildpacks git add .buildpacks git commit -qm "feat: specify $GITHUB_SHA as buildpack" From 9b7f098ced8d6eb50a1ab73da11c4021cfcefb76 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sat, 10 Sep 2022 20:20:44 -0400 Subject: [PATCH 5/5] fix: add whitespace --- bin/ci-pre-deploy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/ci-pre-deploy b/bin/ci-pre-deploy index 3f46867..9a00a66 100644 --- a/bin/ci-pre-deploy +++ b/bin/ci-pre-deploy @@ -25,4 +25,4 @@ if [ "$IS_REVIEW_APP" = "true" ]; then git commit -qm "feat: specify $GITHUB_SHA as buildpack" git rev-parse HEAD >ci-commit-override -fi \ No newline at end of file +fi