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

Uploaded Python 3

File details

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

File metadata

  • Download URL: deploylane-0.1.6.tar.gz
  • Upload date:
  • Size: 15.1 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.6.tar.gz
Algorithm Hash digest
SHA256 2f3b2fda20ce73e6304979f514c0441f31ffbc516289d024403ffe04513409a7
MD5 4a6423bbbf8e9cbb55be259f05a754e5
BLAKE2b-256 9b94b08f12acd0e7632b726dd008d5aca073ff0c7758545597532de3330c4bca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: deploylane-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 15.5 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 3711cf2b725c5fc183b7d554fdc9e0637d239f7256353ea471ed721608e9ac7b
MD5 fb564076dfbd215b19309af0d8397843
BLAKE2b-256 ca06c2675745e6cd560b270e681ec91556b0e32a1f17815729a9c44e1c50adf8

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