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

Uploaded Python 3

File details

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

File metadata

  • Download URL: deploylane-0.1.4.tar.gz
  • Upload date:
  • Size: 14.5 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.4.tar.gz
Algorithm Hash digest
SHA256 c8a221b27c02d19aa41b6f3e2b33002f82ce74f9fb33791974e380117a1a681f
MD5 47a7faeede5924a7f8a32ed5f64d8edb
BLAKE2b-256 20ddb225c32f83f8551d78fa1de41575d3e31e6b4e635bd7a25c5d5ba366df84

See more details on using hashes here.

File details

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

File metadata

  • Download URL: deploylane-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 14.7 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 b228185e24850c876158664e072ecd4b95a079ff68ccc57ac83267d6428fcadb
MD5 1662f860f44876cf96ab0acfe632a986
BLAKE2b-256 73e82b1fd88101e04332a3d458aef3f94803fb3bd76c904cbacdd83fba2c6de4

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