Skip to content
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

How can we use this plugin for manual deploys through cli? #74

Closed
aditya-mitra opened this issue Dec 27, 2020 · 3 comments · Fixed by #83
Closed

How can we use this plugin for manual deploys through cli? #74

aditya-mitra opened this issue Dec 27, 2020 · 3 comments · Fixed by #83
Assignees

Comments

@aditya-mitra
Copy link

First of all, thanks for a very nice and useful plugin.

This plugin works fine when connect to a github repository and installed through the netlify ui.

But, how can I use it deploy my site through the netlify cli?
Repository is not connected to github.

I would love an example or demonstration if possible.

@lindsaylevine
Copy link

lindsaylevine commented Jan 6, 2021

hey @aditya-mitra, thanks so much for opening this issue! we had an issue open regarding plugin usage via the CLI for several weeks but happened to transfer it to an internal private repo yesterday, so unfortunately can't reference that for you here, BUT i can summarize! :D

basically, right now, the plugin will technically "work" with the CLI if you have it installed in your toml file or in the UI of your configured site.

here are the docs for our cli: https://docs.netlify.com/cli/get-started/

in your project directory using the plugin, assuming you've already run netlify login, you can run:

netlify init

this will prompt you to either create & configure a new site linked to your netlify account OR to link it to an existing site. sounds like you already have a site for this project from the UI flow, so select the "link to an existing site" option and navigate to your project's site.

from here, you can run netlify build or netlify deploy --build. this will run the plugin. however, if you have a custom publish or functions dir configured, the build will fail on the second run. this is because we haven't yet written logic to "clean" the plugin-generated files between builds/runs for these custom directories.

this is my number one priority at the moment as i've already promised it to @ChrisBAshton :). unfortunately, it's not super straightforward, so we're getting it done as quickly as we can.

ways around this right now:

  1. this is painful, but you could find the plugin-generated files in your custom functions dir/publish dirs and delete them between netlify builds. you should be able to identify them via git status. another way would be to only run netlify build when all your changes are committed. then you can git stash after every netlify build.
  2. use the next-on-netlify defaults for the time being -> see https://github.com/netlify/next-on-netlify#3-configure-netlify

i know this was all unnecessarily complicated so i can keep you updated when we have this fixed and supported within the plugin and then it should Just Work TM running netlify build. thank you for your patience!!!!!

@lindsaylevine
Copy link

hey all! i released the plugin with these changes so you should be able to run consecutive builds now with the CLI. we do want to improve this fairly fragile logic for right now and think it will require a lot more thought and attention than we can immediately give so hopefully this just gets people going with the CLI. please see the README for the recommended workflow until we can make it fully seamless and automatic. <3

cc @ChrisBAshton

@uinstinct
Copy link

Thanks for the upgrade.
I will try this plugin one more time

serhalp pushed a commit that referenced this issue Apr 5, 2024
…ime node_modules (#74)

* chore: log nft file list

* chore: log metadata

* chore: update

* chore: update

* chore: fix

* chore: update

* chore: fix

* chore: update

* chore: final fix

* chore: cleanup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants