From e38358b7d7198fe8c4cfbff25a572ba1e5b362f6 Mon Sep 17 00:00:00 2001 From: "Giau. Tran Minh" <12751435+giautm@users.noreply.github.com> Date: Mon, 13 Jan 2025 16:45:07 +0700 Subject: [PATCH] src/commands: added `monitor/schema` command (#31) --- src/commands/monitor_schema.yml | 57 +++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/commands/monitor_schema.yml diff --git a/src/commands/monitor_schema.yml b/src/commands/monitor_schema.yml new file mode 100644 index 0000000..47f0d6b --- /dev/null +++ b/src/commands/monitor_schema.yml @@ -0,0 +1,57 @@ +description: > + Sync the database schema to Atlas Cloud +parameters: + working_directory: + type: string + description: Atlas working directory, default is project root + default: "." + cloud_token_env: + type: env_var_name + default: ATLAS_TOKEN + description: | + Environment variable containing the Atlas Cloud token. + If provided, the command will authenticate to Atlas Cloud. + (e.g. `ATLAS_TOKEN`) + url: + type: string + description: "URL of the database to sync (mutually exclusive with `config` and `env`)." + default: "" + config: + type: string + description: + "The URL of the Atlas configuration file (mutually exclusive with `url`). + For example, `file://config/atlas.hcl`, learn more about [Atlas configuration files](https://atlasgo.io/atlas-schema/projects)." + default: "" + env: + type: string + description: "The environment to use from the Atlas configuration file. For example, `dev` (mutually exclusive with `url`)." + default: "" + slug: + type: string + description: "Optional unique identifier for the database server." + default: "" + schemas: + type: string + description: + "List of database schemas to include (by default includes all schemas). + See: https://atlasgo.io/declarative/inspect#inspect-multiple-schemas" + default: "" + exclude: + type: string + description: "List of exclude patterns from inspection. + See: https://atlasgo.io/declarative/inspect#exclude-schemas" + default: "" +steps: + - run: + name: "Sync the database schema to Atlas Cloud" + working_directory: <> + command: | + ATLAS_INPUT_CLOUD_TOKEN=${<>} + atlasaction --action monitor/schema + environment: + ATLAS_INPUT_SLUG: <> + ATLAS_INPUT_SCHEMAS: <> + ATLAS_INPUT_EXCLUDE: <> + ATLAS_INPUT_URL: <> + ATLAS_INPUT_CONFIG: <> + ATLAS_INPUT_ENV: <>