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.7.tar.gz (16.6 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.7-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: deploylane-0.1.7.tar.gz
  • Upload date:
  • Size: 16.6 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.7.tar.gz
Algorithm Hash digest
SHA256 3a7049ee3b64c0bffb38337c4020987eada5045f18899cbb44078755fc076d6c
MD5 f73b32a1867b30329cdc8b1117c77c8e
BLAKE2b-256 805d424b06bfecff4d2282386616bcb2d3bd14aba325c03586edbbad4ffc11af

See more details on using hashes here.

File details

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

File metadata

  • Download URL: deploylane-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 17.0 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a62da0bc3ff2deb0526577721dca3e65f4a35a7f4ac878cad798289a4c21092c
MD5 3f550cfc7abd9e46b50d9846e1a0e43d
BLAKE2b-256 fb5f849c460c3d67fea374e1389d685ffc7a9a6d1e4bf22cb75d1309fd456998

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