Problems with multiple sites linked to a single Bitbucket repository

I got the site “hejdoktor-next.netlify.net.” It’s linked to a single repo project on Bitbucket.

It contains three different build commands. Each of those build commands makes a different output/dist folder.

The first one is auto-deployed to “hejdoktor-next” when the code is merged into the main branch.

The two other output folders should be uploaded to two other Netlify sites.

I have created the three sites. The “hejdoktor-next” site works as it should and is linked to the Bitbucket repository.

I have tried to link the two other sites to the same repository as the “hejdoktor-next” site, but the repository doesn’t show up in the “Link your site to a Git repository” list. Is it only possible to link to a repository once?

My next approach was to call NETLIFY_SITE_ID=[site_id] netlify deploy—-prod—-dir=[The folder to upload]/ on each of the two other output directories, but it resulted in a “MODULE_NOT_FOUND” error. All the output folders contain a static site, and as I understand it, the command should do the same as making a manual upload by dragging the folder to the site in the Netlify UI. So, I don’t know why it throws an error.

Dragging the folders manually to their sites works as expected.

The AI chatbot suggests contacting support.

I can’t provide much information other than to say that I previously had five sites (different ‘regions’ as subdomains) connected to the same repository, each one running different build commands (to specify the region).

So it should be possible.

I’m not sure why you cannot select it when setting up additional instances.

That’s good to know. Then I’ll just have to find out why I can’t link the other two sites. May I ask if you also use Bitbucket?

@wetendorff I’ve used Bitbucket, but no, at the time I was using GitLab.

Found out that my account didn’t have access to show the repository. That part works now, and I can link the site to the repository.

@nathanmartin Thanks for your help.

@wetendorff Excellent, great work figuring out what was going on!