Deployment configs as code. GitLab CI & GitHub Actions variable management CLI.
Project description
DeployLane
Deployment configs as code. GitLab CI variables as code. Reproducible deploys every time.
DeployLane is a CLI for teams deploying containerized apps to Linux servers with Docker Compose and GitLab CI. It replaces scattered shell scripts and manually managed CI variables with a single, version-controlled workflow.
pip install deploylane
dlane login --host https://gitlab.example.com
dlane scaffold my-service
dlane deploy push my-service --yes
Is this for you?
DeployLane fits your stack if:
- ✅ You deploy Docker Compose apps to Linux servers (VPS, bare metal, cloud VMs)
- ✅ You use GitLab CI to build and push images
- ✅ You manage CI variables manually in the GitLab UI and it's becoming a mess
- ✅ You want zero-downtime blue-green deploys without Kubernetes complexity
It's probably not for you if you're on Kubernetes, AWS ECS, or a fully managed PaaS.
The problem it solves
Most teams start with a deploy.sh script that "just works." Over time it becomes:
- Different versions on different servers
- CI variables scattered across projects with no history
- "Works on staging, broken on prod" because someone changed something manually
- New team member spends a day figuring out how deployment actually works
DeployLane makes the entire deployment setup version-controlled and reproducible.
How it works
Your workstation GitLab CI Server
──────────────── ───────────── ──────
dlane scaffold .env
deploy.yml → dlane deploy push → docker-compose.yml
vars.yml deploy.sh
compose/ → dlane deploy install → nginx.conf
nginx/ install.sh (run once)
dlane vars apply → GitLab CI variables ← Pipeline uses these
↓
deploy.sh (zero-downtime or restart)
dlane scaffoldgenerates all server-side files from a singledeploy.ymldlane vars applypushes your localvars.ymlto GitLab CI variablesdlane deploy pushsyncs configs to the server- GitLab CI builds the image and calls
deploy.sh— that's it
Installation
pip install deploylane
Requires Python 3.10+. Works on macOS and Linux.
Quick start (5 minutes)
1. Login
dlane login --host https://gitlab.example.com
# optionally name your profile and set a registry host
dlane login --profile prod --host https://gitlab.example.com --registry-host registry.example.com
2. Create a workspace
A workspace tracks multiple services together.
mkdir ops && cd ops
dlane init
dlane add gateway --gitlab-project acme/gateway --strategy bluegreen
dlane add api --gitlab-project acme/api --strategy plain
3. Scaffold a service
dlane scaffold gateway
This generates .workspace/gateway/.deploylane/ with:
deploy.yml— targets, ports, strategy (edit this to match your server)vars.yml— CI variable definitions (edit values, thenvars apply)compose/,nginx/,scripts/deploy.sh,ci/.gitlab-ci.yml
4. Configure your server details
Edit .workspace/gateway/.deploylane/deploy.yml:
version: 1
strategy: bluegreen
project: acme/gateway
app:
name: gateway
registry_host: registry.acme.com
targets:
prod:
host: 10.0.0.1
user: deploy
deploy_dir: /home/deploy/gateway
ports:
blue: 8080
green: 8081
5. Push CI variables
dlane vars plan gateway # preview what would change
dlane vars apply gateway # push to GitLab
6. Push files to server & install (once per server)
dlane deploy push gateway --yes # .env + docker-compose.yml + deploy.sh
dlane deploy install gateway --yes # nginx + sudoers + runs install.sh
7. Add the CI pipeline
Copy .workspace/gateway/.deploylane/ci/.gitlab-ci.yml to your acme/gateway repo.
GitLab CI will now build, push, and deploy automatically on every push.
Deployment strategies
| Strategy | How it works | When to use |
|---|---|---|
bluegreen |
Two containers, nginx switches traffic — zero downtime | Production |
plain |
Single container, docker compose up -d |
Staging, internal tools |
CI variable management
Stop clicking through the GitLab UI. Manage variables as code:
dlane vars get gateway # pull current GitLab variables → vars.yml
dlane vars diff gateway # see what's different between local and GitLab
dlane vars plan gateway # preview creates / updates / orphans
dlane vars apply gateway # push local vars.yml → GitLab
dlane vars prune gateway # remove GitLab variables not in vars.yml
vars.yml is version-controlled. Every variable change is a git commit.
Variable naming convention:
| Variable | Purpose |
|---|---|
{TARGET}_HOST |
Server IP — e.g. PROD_HOST, STAGING_HOST |
{TARGET}_USER |
SSH user |
{TARGET}_DEPLOY_DIR |
Deploy directory on server |
{TARGET}_SSH_KEY |
Base64-encoded private key |
REGISTRY_HOST |
Docker registry hostname |
REGISTRY_USER |
Registry login user |
REGISTRY_PASS |
Registry login password |
Multi-service workspaces
dlane list # show all services and their status
dlane list --tag api # filter by tag
dlane deploy push --all --yes # push all services at once
dlane vars apply --all # apply variables for all services
Local overrides
Keep production secrets out of git with .local.env files:
# .workspace/gateway/.deploylane/env/prod.local.env (gitignored)
DATABASE_URL=postgres://prod-db:5432/myapp
STRIPE_SECRET=sk_live_...
Local env is merged on top of the base env before pushing. Safe for secrets.
Security
- GitLab token stored at
~/.config/deploylane/config.tomlwith0600permissions - Masked variables shown as
<masked>in all output deploy pushis dry-run by default — requires explicit--yesdeploy installrequires explicit--yesand prompts for sudo password interactively.local.envfiles are gitignored automatically
Add to your .gitignore:
.workspace/
Command reference
Auth
| Command | Description |
|---|---|
dlane login |
Store credentials locally and verify against the API |
dlane logout |
Remove stored credentials |
dlane whoami |
Show current user for the active profile |
dlane status |
Show active profile and login status |
dlane profile list |
List stored profiles |
dlane profile use <name> |
Switch active profile |
Workspace
| Command | Description |
|---|---|
dlane init |
Create workspace in current directory |
dlane add <name> |
Add a service to the workspace |
dlane update <name> |
Update service fields |
dlane remove <name> |
Remove a service |
dlane list |
List services with status |
dlane scaffold <name> |
Generate / refresh deployment files |
Variables
| Command | Description |
|---|---|
dlane vars get <name> |
Fetch GitLab variables → vars.yml |
dlane vars plan <name> |
Preview what would change |
dlane vars diff <name> |
Diff local vs GitLab |
dlane vars apply <name> |
Push vars.yml → GitLab |
dlane vars prune <name> |
Delete GitLab vars not in vars.yml |
Deploy
| Command | Description |
|---|---|
dlane deploy push <name> |
Push .env + compose + deploy.sh to server |
dlane deploy install <name> |
One-time server setup (nginx + sudoers + install.sh) |
dlane deploy history <name> |
Show deployment history |
Tools
| Command | Description |
|---|---|
dlane gitlab list |
Browse GitLab projects |
Development
git clone https://github.com/yourorg/deploylane
cd deploylane
pip install -e ".[dev]"
python -m build
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deploylane-0.2.2.tar.gz.
File metadata
- Download URL: deploylane-0.2.2.tar.gz
- Upload date:
- Size: 51.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
93a9bce93fac9f0245917736076deae29780743a17f65fc24e267ac99af11558
|
|
| MD5 |
ddfc343ae90cce66bbb1ce5fd888dc0f
|
|
| BLAKE2b-256 |
88112038d7ea29c197c5d2213c6595dc3a1837f726060b0ad6e47961421fbc69
|
File details
Details for the file deploylane-0.2.2-py3-none-any.whl.
File metadata
- Download URL: deploylane-0.2.2-py3-none-any.whl
- Upload date:
- Size: 61.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd1317e70bd40272f71bd48dcf986e97620fbe5b8aefe9505739063eecc01c78
|
|
| MD5 |
b6dc4f0f470f28547d82a6ffe075202f
|
|
| BLAKE2b-256 |
85f1ccb731fd496d6fc74919c168777703367f7f2b4f983cf9d58affa505c77e
|