Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nx-ignore is too slow somehow #425

Open
SunStupic opened this issue Sep 27, 2024 · 0 comments
Open

nx-ignore is too slow somehow #425

SunStupic opened this issue Sep 27, 2024 · 0 comments

Comments

@SunStupic
Copy link

SunStupic commented Sep 27, 2024

I'm using nx-ignore in vercel.

The interesting thing is that it takes 2min30s to build my project but 2min50s to ignore my project.

You can see from the screenshot, it only takes 5s to install nx-ignore, but then nx-ignore used 2min50s to ignore my project.

image image

As a comparison, if I skip this step, it will only take 2min30s to build the whole project.

image

Here's the code in my vercel-ignore-build.sh

echo $VERCEL_ENV
echo $VERCEL_PROJECT_NAME
echo $VERCEL_GIT_COMMIT_REF

# When git branch is release-<project-name>, it is a release branch
if [[ $VERCEL_GIT_COMMIT_REF == release-* ]]; then
  # If release branch name matches project name, deploy this project
  if [ $VERCEL_PROJECT_NAME = ${VERCEL_GIT_COMMIT_REF#release-} ]; then
    echo "Triggered by push commit on release branch " $VERCEL_GIT_COMMIT_REF " of project " $VERCEL_PROJECT_NAME.
    exit 1;
  else
    echo "Ignore other project's release branch. Skip build for project " $VERCEL_PROJECT_NAME
    exit 0;
  fi
elif [ $VERCEL_GIT_COMMIT_REF = 'master' ]; then
  echo "Triggered by `master` branch push or PR merge"
  exit 1;
elif [ $VERCEL_ENV = 'production' ]; then
  echo "Triggered by vercel production branch push"
  exit 1;
else
  echo "compare with master branch in preview"

  npx nx-ignore $VERCEL_PROJECT_NAME
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant