netlify / cli

Netlify Command Line Interface
http://cli.netlify.com
MIT License
1.57k stars 350 forks source link

Branch domain support #948

Open Sceat opened 4 years ago

Sceat commented 4 years ago

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/ ?

Lanchi commented 4 years ago

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

drewrawitz commented 4 years ago

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!

shukryzablah commented 3 years ago

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

zbruhnke commented 3 years ago

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

arpadgabor commented 2 years ago

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 commented 2 years ago

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

fostimus commented 1 year ago

this would be great, we could also use this

pixelart7 commented 1 year ago

+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)

jame-earnin commented 1 year ago

I think it is the most common feature request.