Skip to content

Commit

Permalink
ep/add deploy int command (#6078)
Browse files Browse the repository at this point in the history
* Add @netlify/sdk as a dependency.

Create the 'int' command for Netlify Integrations.

Create a test 'init' subcommand.

* Import init method from Netlify SDK and invoke it

* Add await

* More lint things

* Add 'int' as alias for 'integration'

* Fix import

* Add build command

* Add the dev and preview commands

* Rename

* Conditionally add the integration command based on a feature flag.

Autogenerate docs (though they're missing subcommands, need to look into that)

* Rename files

* Forgot to uncomment this logic

* Add skeleton of deploy command for netlify integrations

* WIP commit. General outline of the integration deploy command

* WIP commit

* Pin the version of configstore to 5.

This is because v6 is pure ESM and it's leading to errors within the content-engine dependency (that's coming from @netlify/sdk).

Hopefully this is temporary fix until we can address it within the content-engine dependency

* Get integration information from integration service when site is linked

* Update slug automatically if it differs from jigsaw since it's the source of truth.

* update packages

* WIP commit

* Add logic for updating the integration info on remote.

Update the local config file for the integration when needed

* Add error handling on request to remote

* Add logic for registering an integration on the remote

* Add the deploying of the integration site

* WIP commit

* Slight reorg of code. Still needs further refactoring

* Update package.json

Fix reference

* Move register functionality to it's own function

* Move update functionality to it's own function

* Support env variables

* Make some changes based on initial code walkthrough with team

* Remove outdated comment

* Fix lint issues

* Trying to debug error in github actions

* Revert change made for debugging

* Update reference to @netlify/sdk

* Show error message from remote when one is returned

* add exit statements that were missing

* chore: run docs build

* chore: lintfix

* chore: prettier

* feat: convert to command:subcommand as is in the rest of the cli

* docs: add subcommands in docs

* chore: rename folder to match command name

* chore: prettier

* test: test for integration:init

* chore: remove unused import

* test: dev command

* test: add tests to make sure sdk is being called

* chore: update version of sdk

* chore: remove mystery markdown-magic

* test: starting on tests for deploy

* test: trying to get these mocks going

* test: more progress on test

* feat: add integrationLevel to integration deploy

* Exit process if required fields are missing

* Move reading the integration configuration to earlier in the order of operations

* Add integrationLevel to what's written in the yaml file

* test: passing test of deployment

* chore: prettier

* Add better error messaging.

Deploy to prod if atttepting the deploy and are registering the integration for the first time

* Run prettier

* Update link

* Support passing in the build flag to the int:deploy command

* chore: update sdk so integrationlevel validation works correctly

* Changes from docs review

* lint

* Missed including the level

* docs: docs review rewording

* feat: remove integration:init command

* docs: doc review changes

* docs: run docs build

* chore: format

* docs: remove beta

* feat: remove all but integration:deploy

* docs: remove docs for removed commands

* chore: package lock merge conflicts

* chore: merge conflict

* chore: update sdk version

* feat: add logging for finished, and be clearer in the deploy function

* feat: add shortened url

* fix: missing imports

---------

Co-authored-by: Erica Pisani <[email protected]>
Co-authored-by: Sarah Etter <[email protected]>
Co-authored-by: khen <[email protected]>
  • Loading branch information
4 people authored Oct 19, 2023
1 parent 52f5d9f commit aa9b0be
Show file tree
Hide file tree
Showing 15 changed files with 5,276 additions and 513 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ See the [CLI command line reference](https://cli.netlify.com/commands/) to get s
- [env](#env)
- [functions](#functions)
- [init](#init)
- [integration](#integration)
- [link](#link)
- [login](#login)
- [open](#open)
Expand Down Expand Up @@ -165,6 +166,15 @@ Manage netlify functions

Configure continuous deployment for a new or existing site. To create a new site without continuous deployment, use `netlify sites:create`

### [integration](/docs/commands/integration.md)

Manage Netlify Integrations built with the Netlify SDK

| Subcommand | description |
|:--------------------------- |:-----|
| [`integration:deploy`](/docs/commands/integration.md#integrationdeploy) | Register, build, and deploy a private integration on Netlify |


### [link](/docs/commands/link.md)

Link a local repo or project folder to an existing site on Netlify
Expand Down
9 changes: 9 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,15 @@ Manage netlify functions

Configure continuous deployment for a new or existing site. To create a new site without continuous deployment, use `netlify sites:create`

### [integration](/docs/commands/integration.md)

Manage Netlify Integrations built with the Netlify SDK

| Subcommand | description |
|:--------------------------- |:-----|
| [`integration:deploy`](/docs/commands/integration.md#integrationdeploy) | Register, build, and deploy a private integration on Netlify |


### [link](/docs/commands/link.md)

Link a local repo or project folder to an existing site on Netlify
Expand Down
9 changes: 9 additions & 0 deletions docs/commands/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,15 @@ Manage netlify functions

Configure continuous deployment for a new or existing site. To create a new site without continuous deployment, use `netlify sites:create`

### [integration](/docs/commands/integration.md)

Manage Netlify Integrations built with the Netlify SDK

| Subcommand | description |
|:--------------------------- |:-----|
| [`integration:deploy`](/docs/commands/integration.md#integrationdeploy) | Register, build, and deploy a private integration on Netlify |


### [link](/docs/commands/link.md)

Link a local repo or project folder to an existing site on Netlify
Expand Down
49 changes: 49 additions & 0 deletions docs/commands/integration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
title: Netlify CLI integration command
description: Create, develop, and deploy integrations.
---

# `integration`

<!-- AUTO-GENERATED-CONTENT:START (GENERATE_COMMANDS_DOCS) -->
Manage Netlify Integrations built with the Netlify SDK

**Usage**

```bash
netlify integration
```

**Flags**

- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `debug` (*boolean*) - Print debugging information

| Subcommand | description |
|:--------------------------- |:-----|
| [`integration:deploy`](/docs/commands/integration.md#integrationdeploy) | Register, build, and deploy a private integration on Netlify |


---
## `integration:deploy`

Register, build, and deploy a private integration on Netlify

**Usage**

```bash
netlify integration:deploy
```

**Flags**

- `auth` (*string*) - Netlify auth token to deploy with
- `build` (*boolean*) - Build the integration
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `prod` (*boolean*) - Deploy to production
- `site` (*string*) - A site name or ID to deploy to
- `debug` (*boolean*) - Print debugging information

---

<!-- AUTO-GENERATED-CONTENT:END -->
Loading

2 comments on commit aa9b0be

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

  • Dependency count: 1,654
  • Package size: 477 MB

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

  • Dependency count: 1,654
  • Package size: 477 MB

Please sign in to comment.