Skip to content

Commit

Permalink
build: custom vercel script to ignore 'next' branch commits (#5515)
Browse files Browse the repository at this point in the history
* 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 <github@mikehardy.net>
  • Loading branch information
dackers86 and mikehardy authored Jul 16, 2021
1 parent 61259ed commit f47a7c7
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions script.sh
Original file line number Diff line number Diff line change
@@ -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

1 comment on commit f47a7c7

@vercel
Copy link

@vercel vercel bot commented on f47a7c7 Jul 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.