Use Netlify to Host PR Previews with Jenkins-Handled Builds

Hi team,

We are currently using Jenkins to handle our builds because it has access to the Nexus private registry via environment variables. We also use Netlify for hosting PR previews.

However, when a PR is raised, Netlify’s default build fails since it doesn’t have access to the Nexus token required to install private packages. To resolve this, we are planning to:

  • Let Jenkins handle the build process using its environment variables and .npmrc.
  • Then use Netlify CLI from Jenkins to deploy the built app as a preview.
  • We have a monorepo with 4 apps, and we want to deploy a preview only for the app that has changed in the PR.

Questions:

  1. Is it possible to deploy the Jenkins-built app to Netlify as a PR preview using the CLI?

  2. Are there any restrictions or known issues when using Netlify CLI deployments in Jenkins pipelines?

1 Like

Hi, @Dhivakar-acv . It is not possible to use branch deploy or deploy preview workflows at Netlify when the site is deployed via the “manual deploy” workflow (as opposed to the “build and deploy” workflow).

There is an open feature request to support branch deploy and deploy preview workflows with manual deploys and your interested as been added to the existing feature request.