Skip to main content

DeployLane - GitLab-focused deployment helper CLI

Project description

DeployLane (dlane)

GitLab-focused deployment helper CLI for deterministic CI/CD operations:

  • Store GitLab credentials locally (not in repo)
  • List projects
  • Manage project variables via a local YAML file (export/apply/diff)
  • Keep infra workflows reproducible without coupling to Git state

Important: .deploylane/ is local-only. Do not commit it.


What is DeployLane?

DeployLane is a small CLI that sits between your workstation and GitLab:

  • You log in once (PAT stored in ~/.config/deploylane/config.toml)
  • You can export GitLab project variables into a local YAML file
  • You can edit YAML, then apply changes back to GitLab deterministically
  • You can diff local YAML vs GitLab before applying

This makes GitLab variables manageable as files, without placing secrets in app repos.


Install

From PyPI

pip install deploylane

Run

dlane --help

Authentication

Create a GitLab Personal Access Token (PAT)

In GitLab UI:

  • User Settings → Access Tokens
  • Scopes (minimum recommended):
    • read_api (for listing projects, reading variables)
    • api (required if you want to set/update variables)

If you only read, read_api can be enough. For writes, you usually need api.

Login (interactive)

dlane login --host https://gitlab.example.com

If you omit --host, it uses the default or prompts.

Login (non-interactive / CI-friendly)

export GITLAB_HOST="https://gitlab.example.com"
export GITLAB_TOKEN="glpat-xxxx"
dlane login --non-interactive

Status / WhoAmI

dlane status
dlane whoami

Logout

dlane logout

Config & Profiles

DeployLane stores credentials locally:

  • Config path:
    • ~/.config/deploylane/config.toml
  • Supports profiles (e.g. default, staging, prod)

Example:

dlane login --profile default --host https://gitlab.example.com
dlane login --profile corp --host https://gitlab.example.com

Switching active profile is handled by whichever profile was last set as active (per your CLI logic).

Debug:

dlane config-show
dlane host-normalize --host gitlab.example.com

Projects

List projects visible to your token:

dlane projects-list

Search:

dlane projects-list --search <project>

Owned only:

dlane projects-list --owned

Membership filtering:

dlane projects-list --membership
dlane projects-list --no-membership

Variables (Project-level)

DeployLane uses a local YAML file to manage GitLab project variables.

Default file location

By default, you can keep it in the repository root but not committed:

  • .deploylane/vars.yml

This is local-only state. Add it to .gitignore.

Export variables (GitLab → YAML)

dlane vars-get --project <group>/<project>

Write to a specific file:

dlane vars-get --project <group>/<project> --out .deploylane/vars.yml

If the project has no variables, DeployLane writes a demo template so you can start editing immediately.

Diff (YAML vs GitLab)

dlane vars-diff --project <group>/<project>

Use a specific YAML file:

dlane vars-diff --project <group>/<project> --file .deploylane/vars.yml

Apply (YAML → GitLab)

This will create/update variables defined in YAML.

dlane vars-apply --project <group>/<project>

Or:

dlane vars-apply --project <group>/<project> --file .deploylane/vars.yml

Current behavior: applies all entries in YAML (create/update).
Deletions are intentionally not handled yet.


YAML Format

Example .deploylane/vars.yml:

project: <group>/<project>
scope: "*"
variables:
  PROD_HOST:
    value: 192.168.1.2
    masked: true
    protected: true
    environment_scope: "*"
  REGISTRY_USER:
    value: gitlab+deploy-token-1
    masked: true
    protected: true
    environment_scope: "*"

Notes:

  • scope: "*" is currently informational (kept for future expansion).
  • environment_scope controls GitLab variable environment targeting.

Security Notes (Very important)

  • Do NOT commit .deploylane/vars.yml if it contains secrets.
  • Prefer storing sensitive values in GitLab variables and pulling them when needed.
  • Local .deploylane/ is for deterministic management, but it’s still sensitive.

Recommended .gitignore:

.deploylane/
*.env
.env

Roadmap (next steps)

  • Safer apply:
    • --dry-run (show changes without applying)
    • --only KEY1,KEY2 (apply subset)
  • Optional deletion flow:
    • explicit vars-delete KEY (single variable)
  • Group/instance variable support (future)
  • Deployment helpers (later):
    • ship compose / snippets as artifacts (Generic Packages)
    • deterministic server-side fetch + apply

Development

Run locally:

dlane --help

Build (requires build):

pip install build
python -m build

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deploylane-0.1.5.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deploylane-0.1.5-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file deploylane-0.1.5.tar.gz.

File metadata

  • Download URL: deploylane-0.1.5.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for deploylane-0.1.5.tar.gz
Algorithm Hash digest
SHA256 82cc20261e2c8dc5e04a3d03b15b6c2290b079546fb2b12118a2f4a130215fcc
MD5 8d1e522794c3eddee21d88d447010910
BLAKE2b-256 702a0cf84f320777596697a882219e7f51ec4e76c8b804ce5bf1acee6272d44d

See more details on using hashes here.

File details

Details for the file deploylane-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: deploylane-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for deploylane-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 5d8c7759813e365ad3c30b44f789e03e38a93b1e7b298229141a1c0bcd529c71
MD5 83dd619e75e6c8888e8b8cd1307370d3
BLAKE2b-256 d574fe1732e813fbf17c46b829095d3e8bc4001efae08a53927a4da9c1367915

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page