From f47a7c765ed811085e873bb11fffa7954f41b47c Mon Sep 17 00:00:00 2001 From: Darren Ackers Date: Fri, 16 Jul 2021 17:41:55 +0100 Subject: [PATCH] build: custom vercel script to ignore 'next' branch commits (#5515) * Added ignore build step for next deployments Note this is connected to Vercel configuration, if this script is removed or altered, the Vercel configuration on their console should be consulted and/or changed Co-authored-by: Mike Hardy --- script.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 script.sh diff --git a/script.sh b/script.sh new file mode 100644 index 0000000000..daee09127d --- /dev/null +++ b/script.sh @@ -0,0 +1,22 @@ +#!/bin/bash +# As we currently have two deployments of react-native-firebase. +# One is one producetion https://vercel.com/invertase/react-native-firebase +# Another is new modules located at https://vercel.com/invertase/react-native-firebase-next + +# This script when combined with the ignore build step command https://vercel.com/invertase/react-native-firebase-next/settings/git +# ensures that only the @invertase/next will cause a build on the new modules deployments. + +# This does not affect the main production deployment. + +echo "VERCEL_GIT_COMMIT_REF: $VERCEL_GIT_COMMIT_REF" + +if [[ "$VERCEL_GIT_COMMIT_REF" == "@invertase/next" ]] ; then + # Proceed with the build + echo "✅ - Detected this is a build of @invertase/next - build can proceed" + exit 1; + +else + # Don't build + echo "🛑 - This is not a build of @invertase/next build cancelled" + exit 0; +fi