cli icon indicating copy to clipboard operation
cli copied to clipboard

Branch domain support

Open Sceat opened this issue 5 years ago • 6 comments

Feature request

Now that we can branch deploy through the cli #275 , how can we add a domain on the generated https://<branch>--<app name>.netlify.app/ ?

Sceat avatar Jun 12 '20 15:06 Sceat

Apparently, it's not possible to do so: Setting Branch Subdomain for Manual Branch Deploys

Lanchi avatar Jun 29 '20 07:06 Lanchi

My workaround for this right now is something like this:

  "scripts": {
    "deploy": "cross-env BRANCH=$(git symbolic-ref --short HEAD) USER=\"$(git config user.name)\" yarn deploy:branch",
    "deploy:branch": "cross-env-shell yarn build && netlify deploy --dir dist --open --alias $BRANCH --message \"A new local branch deploy from branch $BRANCH by $USER.\"",
  },

So I just run yarn deploy in the command line to kick off a Netlify build that uses the current branch name as the alias. It works ok, the problem that I'm noticing are the unpredictable URL's.

Some examples:

Alias Result
feature-5345-cm-icon-picker Not found
iconpicker Not found
icon-picker Successful

I have no idea why the first two don't work, but the last one with a dash in it worked just fine. I haven't been able to figure out the pattern for what makes a successful URL. I'm currently in contact with support, so I'll report back any findings. If anyone else has any ideas, please let me know!

drewrawitz avatar Jun 30 '20 18:06 drewrawitz

I would also like to point my domain to the aliased branch deploy

shukryzablah avatar Dec 22 '20 22:12 shukryzablah

adding a +1 for this as it would be a major help to our current workflow!

zbruhnke avatar Jan 05 '21 21:01 zbruhnke

We are also looking for support in this regard! We are using cli deploys because (1) we can check logs faster, (2) we can add additional checks in pipelines (e.g. Sonar scanning) and (3) we are migrating to Trunk Based Development, so we are using the main branch for development and we create separate release branches, all of the logic being handled inside GitHub Actions. Having custom domains in branch deploys (even just setting up some hardcoded ones manually is fine) would help a lot.

arpadgabor avatar Apr 10 '22 17:04 arpadgabor

Do we have any update on this request? Maybe if there has been any progress on the backend side at least? Not sure who to ping, @erezrokah @khendrikse

arpadgabor avatar Jul 28 '22 09:07 arpadgabor

this would be great, we could also use this

fostimus avatar Oct 27 '22 22:10 fostimus

+1 for this. My team moved to Netlify DNS for this feature but unexpected when it only apply to netlify.app domain (build then deploy with alias)

pixelart7 avatar Jul 20 '23 18:07 pixelart7

I think it is the most common feature request.

jame-earnin avatar Jul 25 '23 22:07 jame-earnin