-
Notifications
You must be signed in to change notification settings - Fork 368
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
Set Deploy Context / Branch from CLI #275
Comments
It's an interesting idea and suggestion. I like it. |
just fwiw we have some concerns on our end about how this may conflict with other features and considerations we have yet to announce - so no promises on how quickly we will incorporate this. but in principle i agree this is a useful thing to have. the devil is in the details. |
We need that too! Out use case is that we use CircleCI for everything. And we use Netlify to host our static frontend. So, effectively we're running out builds in 2 places (duplication), while it would be really nice to use CircleCI for everything and just send files over to Netlify. While doing that we're missing "Branch deploy" feature which is really nice. |
Related: #44 |
Very much would appreciate this functionality as well. |
Just adding to this with my current situation... I am making a group portfolio site for a graduating design class. I am making a site with GatsbyJS, which creates image thumbnails on build. This site has many fairly-large images, so it must sometimes be deployed with the CLI if there are updates that the cache isn't being cycled from (say, new images under the same name as old ones). Small updates tend to work okay, because I'm using gatsby-plugin-netlify-cache. This works fine, but only so long as the master branch is the one being deployed to the prod URL, so that I can deploy from the CLI if there is any issue updating the cache. This leads to my current issue: I have now deployed a "coming soon" countdown to the main URL and put the master behind a branch deploy. Unfortunately, this means I can't find a way to deploy the master from the CLI to its branch URL. I can only deploy either a preview or to --prod. Unfortunately, deploying to --prod puts the work-in-progress master branch onto the public URL. My current workaround is to simply update the filename of any changed image ... but this isn't a great solution, and I worry if one of the pages on the site adds a lot of images (which might exceed the Netlify build time in thumbnail creation time), I might be stuck without a way to update the This is a bit of a complex issue and maybe an edge case, but I hope it shows a scenario in which an option like |
acknowledged the importance of this. |
We would like to run our end-to-end tests against deploy preview URLs, so passing the context/branch into the deploy command would help us as well to automate that process. |
should inform customers in addition to this thread: |
I'm using Gitlab CI and facing the same problem. |
Got the latest version of the CLI
No, no progress so far |
I wrote a guide Deploy a static website to Netlify using GitLab's CI/CD pipeline. Until now I was successfully only deploying the master branch build to the netlify production deploy: # Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
image: node:10
stages:
- test
- deploy
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- node_modules/
before_script:
- npm install hexo-cli -g
- npm install
test:
stage: test
script:
- hexo generate
except:
- master
pages:
stage: deploy
script:
- hexo generate
- npm install netlify-cli -g
- netlify deploy --site $NETLIFY_SITE_ID --auth $NETLIFY_AUTH_TOKEN --prod --dir public/
artifacts:
paths:
- public
only:
- master But now I want to create a preview deploy for any other branches, so I moved my Gitlab CI config to # Official framework image. Look for the different tagged releases at:
# https://hub.docker.com/r/library/node/tags/
image: node:10
stages:
- test
- deploy
# This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache
cache:
paths:
- node_modules/
before_script:
- npm install hexo-cli netlify-cli -g
- npm install
test:
stage: test
script:
- hexo generate
# Wihthout the --prod option this deploys only a preview
- netlify deploy --site $NETLIFY_SITE_ID --auth $NETLIFY_AUTH_TOKEN --dir public/
except:
- master
pages:
stage: deploy
script:
- hexo generate
- netlify deploy --site $NETLIFY_SITE_ID --auth $NETLIFY_AUTH_TOKEN --prod --dir public/
artifacts:
paths:
- public
only:
- master So in the But unfortunately the job always end like this:
Actually all preview URLs from the production are looking like https://5dfe3d1423a010917b502c04--rawsec-blog.netlify.com/ and I don't care not having a custom https://stagging--rawsec-blog.netlify.com/ URL. I should just be able to see a difference bewteen production and non-production deploy thanks to the Edit I read the only working workaround was to create a separate netlify project, see https://medium.com/js-dojo/deploying-vue-js-to-netlify-using-gitlab-continuous-integration-pipeline-1529a2bbf170#3e81 to get a proper stagging preview which is very heavy in term of process. Also I should add I'm only using Gitlab-CI and netlify CLI, not the integrated netlify git link feature. |
Nice, seems to be some movement on this issue. We're also coming from Gitlab, and would like to use similar functionality as branch deploy, but run from the Gitlab CI via the Netlify CLI. We have many other jobs we want to run (test/lint/e2e/etc), so it feels better to keep it in the same place. |
This issue has been raised internally with the API team to implement an endpoint that would allow creating branch deploys. Please hold on. |
Thanks for the update! Is there any rough ETA - ie it'll be a matter of days/weeks/months? |
We don't have an ETA at the moment but since this is a highly requested feature we'll prioritize it and report back when we have a plan. |
@RaeesBhatti this feature would be a blessing for our team since our code is on Bitbucket and we don't have access to deploy previews as a result. We're really stuck at the moment. Just an API endpoint would unblock us. |
Any update on this issue. |
Yes! This would be a life saver for projects/companies that rely on netlify but have to, for whatever business/security reasons, have complete control of their deploy pipeline/git repository. |
Right now i have to use one site per branch it kinda overflow my netlify dashboard, i'd be interested in this |
Thank you 🎉 |
|
Thanks for the other PR as well! netlify/js-client#105
|
Exciting update! Now we can have nice aliases for our deploys. I did some testing and noticed it doesn't seem to work with Is that accurate? Or am I doing something wrong? |
@rajington Yes |
Thanks, not supporting trigger is not a huge problem or anything. I was guessing split-testing is a whole other can of worms and not really part of this "alias" stuff, is that accurate? Also completely understand if it's not a priority, prob not many people are using split-testing with CLI deploys. |
We're considering renaming the recently introduced |
The author is considering the same thing for the GitHub Action! nwtgck/actions-netlify#178 (comment) |
I'm not sure if I understand the Currently I have a custom domain, $ netlify deploy --dir=build --branch=redux
Deploy path: /home/runner/work/react-ecomm-site/react-ecomm-site/build
Configuration path: /home/runner/work/react-ecomm-site/react-ecomm-site/netlify.toml
Deploying to draft URL...
- Hashing files...
✔ Finished hashing 41 files
- CDN diffing files...
✔ CDN requesting 16 files
- Uploading 16 files
✔ Finished uploading 16 assets
- Waiting for deploy to go live...
✔ Deploy is live!
Logs: https://app.netlify.com/sites/react-ecomm/deploys/5edcdff41311f812dcd11514
Website Draft URL: https://redux--react-ecomm.netlify.app I was under the impression that it will deploy to |
We don't "deploy to" hostnames like that; we can show deploys at hostnames
like that, once configured. You seem to have it configured correctly, here:
https://app.netlify.com/sites/react-ecomm/settings/domain#branch-subdomains
Does https://redux.shopit.space not work as you're intending? I can see it
serves that site, but can't tell if it's the content you're expecting or
not.
TL;DR that notification will use our internal name, but you should be able
to use the other one once it is (as it is on your site) correctly
configured as a branch subdomain and the SSL certificate matches, which
yours does (*.shopit.space)
…On Sun, Jun 7, 2020 at 5:29 AM Malcolm Kee ***@***.***> wrote:
I'm not sure if I understand the --branch flag correctly.
Currently I have a custom domain, shopit.space, in which the redux branch
will be deployed to redux.shopit.space. When I execute netlify deploy -b
redux, what I get is the following logs:
Logs: https://app.netlify.com/sites/react-ecomm/deploys/5edcdbcdeb4b84deeb7c7203
Website Draft URL: https://redux--react-ecomm.netlify.app
I was under the impression that it will deploy to redux.shopit.space but
apparently it does not. It this behavior expected?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#275 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABX5IBYCP7MCLQQ5G4LAM3RVOBZXANCNFSM4HCEPHVA>
.
|
@fool the ui don't allow me to have a subdomain without linking the site to a git repository :/ |
Not entirely surprising. Shall I try unlinking the git repo to see if it
still works (won't show up in the UI, but that is not the purpose of this
feature request - it's to get it working :))
…On Mon, Jun 8, 2020 at 1:59 PM Sceat ***@***.***> wrote:
@fool <https://github.com/fool> the ui don't allow me to have a subdomain
without linking the site to a git repository :/
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#275 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABX5IFA22M73CKPUQ7RTIDRVVGLHANCNFSM4HCEPHVA>
.
|
not sure if this where you'd like to talk about potential issues with this specific functionality, but I don't seem to be getting function output in the console even though I can run the functions. if nothing big jumps out at you i can debug more, but it seems to be related to this. |
You're saying that function output from the branch you deploy this way is
not showing in the UI, Raj? That is likely related and not sure it's
intended to work, but I know who to ask once you can confirm (and if
possible give me the function name and the site's API ID from the settings
page to track it down internally to confirm, since I have no functions
deployable via CLI right now to test with..)
…On Wed, Jun 10, 2020 at 6:00 AM Raj Nigam ***@***.***> wrote:
not sure if this where you'd like to talk about potential issues with this
specific functionality, but I don't seem to be getting function output in
the console even though I can run the functions. if nothing big jumps out
at you i can debug more, but it seems to be related to this.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#275 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABX5IAQ5TJ2CFBLTPBNKBDRV57XLANCNFSM4HCEPHVA>
.
|
When will |
@Sceat |
@RaeesBhatti is there any update on getting |
Hi @alexjfno1, I opened a new issue #1572 to track this as it will require some API changes. |
Thanks @erezrokah |
Not sure if this is a question or a recommendation at this point.
I'm trying to create a dedicated staging (pre-prod) environment: e.g. staging--myproject.netlify.com.
I am manually deploying in my GitLab pipeline using
netlify deploy
. However, with the CLI it seems I can only deploy to (i) my production URL or (ii) a dynamic URL.Ideally, I'd like to specify the context similar to
netlify deploy --context=staging
to deploy to a dedicated URL.Thank you for any insight.
The text was updated successfully, but these errors were encountered: