Skip to main content

deploy-connector

Package and deploy a Fivetran connector to Fivetran. Use when the user wants to deploy or ship their connector.

跳到安装

来源信息

仓库
fivetran/connector_sdk_tools
最近来源活动
2026年9月11日 18:54
检测到的 SKILL.md 语言
英语
星标
88
分支
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
deploy-connector
description
Package and deploy a Fivetran connector to Fivetran. Use when the user wants to deploy or ship their connector.
> **Context**: This plugin is for the Fivetran Connector SDK (CSDK). "CSDK" is shorthand for "Connector SDK". # Deploy Fivetran Connector **FIRST**: Read `sdk-reference.md` from the plugin directory to load SDK rules and patterns. Package and deploy the connector in the current directory. ## Step 1: Pre-Deployment Validation Verify the connector is ready: 1. **Files exist**: `connector.py`, `requirements.txt`, `README.md`; `configuration.json` when supplying configuration. 2. **Code quality**: Read `connector.py` and check for: - Both `schema()` and `update()` functions present - `connector = Connector(update=update, schema=schema)` in global scope - `if __name__ == "__main__": connector.debug()` entry point - No forbidden patterns (`Dict[str, Any]`, `Generator[op.Operation, ...]`, `op.Operation` in type hints) 3. **Configuration**: `configuration.json` is JSON. Plaintext string values are supported; do not require custom encryption. Do not read, print, copy, or deploy plaintext configuration values in chat. ## Step 2: Run Final Test Use the secure runner: ```bash python "<plugin>/tools/run_connector.py" "<connector_directory>" --timeout-seconds 600 ``` The runner defaults to 120 seconds and accepts up to 600. Use 600 for debug runs because the first run downloads and starts the Java tester. Set the harness command timeout to 600 seconds as well. If the test fails, classify the error (INFRA / FIRST_RUN / CODE) and — for CODE errors — apply the fixer workflow (see `workflows/fixer.md` in the plugin, or — in plugins that support subagents — invoke the `connector-fixer` subagent). ## Step 3: Deploy For an existing connection, use its ID so the tool reuses its current name and destination without listing destinations or prompting: ```bash python "<plugin>/tools/deploy_connector.py" "<connector_directory>" --connection-id "<id>" ``` For a new connection, supply the destination (group) name and optionally a connection name; otherwise the connection name is derived from the directory: ```bash python "<plugin>/tools/deploy_connector.py" "<connector_directory>" --destination "<name>" --connection "<name>" ``` The tool reads `FIVETRAN_API_KEY`, passes local configuration through a named pipe when present, and invokes `fivetran deploy --destination <name> --connection <name> --force`. For an existing connection it reads connection details and then that connection's group details. Do not combine `--connection-id` with name or destination overrides. If no destination is supplied for a new connection, a single available destination is selected automatically. Multiple destinations require a selection on stdin or an explicit argument. Harnesses without an input channel should pass the target explicitly. Closed input ends the command; do not retry without providing the target. A missing local configuration file is allowed; the SDK may still use environment configuration. Preserve production settings during code repairs and verify the installed SDK's configuration behavior before deploying. Do not confuse local test inputs with the production configuration. For required configuration or unusable encrypted values, follow **Configuration entry** in `sdk-reference.md`. Plaintext values are supported without a key; do not require re-entry or encryption of user-supplied values. ### Prerequisite: `FIVETRAN_API_KEY` If the user hasn't set the env var, the tool exits with a clear message. Direct the user to: 1. Create a Fivetran API key at https://fivetran.com/dashboard/user/api-config. It must be the base64-encoded `{key}:{secret}` string, with permission to manage connections and read destinations (so destination lookup, deploy, and unpause all work). 2. Add it to their shell config. macOS/Linux: ```bash export FIVETRAN_API_KEY=... ``` Windows PowerShell: ```powershell setx FIVETRAN_API_KEY "..." ``` 3. Reload their shell and re-run the deploy command. ### If no destinations exist If the user has zero destinations, the tool exits with a link to the destinations page. Direct the user to create one in the dashboard (requires warehouse credentials) and re-run deploy. Reference: https://fivetran.com/docs/connector-sdk/working-with-connector-sdk#deploytheconnector ## Step 4: Offer to Start the Initial Sync A newly deployed connection is created **paused**. Deploying does not start a sync. After a successful deploy, surface the Connection ID and dashboard link the tool printed, then **ask the user** whether to start the initial sync now. State plainly that starting the sync begins consuming [MAR](https://fivetran.com/docs/core-concepts/usage-based-pricing#monthlyactiverows). Do not start it automatically. Only if the user explicitly confirms, unpause the connection: ```bash python "<plugin>/tools/deploy_connector.py" "<connector_directory>" --start-sync --connection-id "<id>" ``` This calls `PATCH /v1/connections/{id}` with `{"paused": false}`; Fivetran then begins the initial sync. If the user declines, tell them they can start it anytime from the dashboard link or by re-running the command above. ## Redeploying (updating an existing connection) To update a deployed connection, use `--connection-id <id>`. This preserves its name and destination even when the recovered project directory has a different name. Redeployment replaces code and supplied configuration; it does not itself unpause the connection. Verify connection health after deployment and use the explicit start-sync path only when authorized. ## Alternative: Manual Packaging If the user prefers manual deployment (e.g., wants to inspect the package before upload): 1. Build the deployable archive: ```bash fivetran package ``` This produces a ZIP containing `connector.py`, `configuration.json`, `requirements.txt` (or `pyproject.toml`), `README.md`, and any additional source files, respecting `.gitignore`. 2. Upload via the Fivetran dashboard.
在 GitHub 查看