Scripts

Available scripts for managing /dev/push.

All scripts are in /opt/devpush/scripts/.

Is sudo required?

Scripts that manage services (start.sh, stop.sh, restart.sh, install.sh, update.sh, uninstall.sh) or access system directories (backup.sh, restore.sh) require sudo. Development scripts (db-generate.sh, clean.sh, status.sh, compose.sh) can run without sudo if your user is in the docker group.

Script Description
backup.sh Create backup of data, database, and metadata
build-runners.sh Build runner Docker images
clean.sh Stop stack and clean development data
compose.sh Docker Compose wrapper with correct config
db-generate.sh Generate Alembic migration
db-migrate.sh Apply database migrations
install.sh Install /dev/push on a server
restart.sh Restart services
restore.sh Restore from backup archive
start.sh Start the stack
status.sh Show stack status
stop.sh Stop services
uninstall.sh Remove /dev/push from server
update.sh Update to a new version

backup.sh

Create a backup archive containing the data directory, database dump, and version metadata.

sudo /opt/devpush/scripts/backup.sh

Backups are saved to /var/backups/devpush/ by default.

Option Description
--output <file> Custom output path for the backup archive
--verbose Show detailed output

build-runners.sh

Build the Docker images used for running deployments. Called automatically during installation and updates.

sudo /opt/devpush/scripts/build-runners.sh
Option Description
--no-cache Build without using Docker cache
--image <name> Build only a specific runner image

clean.sh

Stop services and remove all Docker resources (containers, volumes, networks, images) and data directory.

./scripts/clean.sh

Note: Can run without sudo if your user is in the docker group.

Option Description
--keep-docker Keep Docker resources (containers, volumes, networks, images)
--keep-data Keep data directory
--yes Skip confirmation prompts

Destructive operation

This script removes all Docker resources and data. Use with caution, especially in production.

compose.sh

Wrapper around docker compose that automatically loads the correct configuration files and environment.

./scripts/compose.sh logs -f app
./scripts/compose.sh exec app bash

Note: Can run without sudo if your user is in the docker group.

Pass any Docker Compose command after --:

./scripts/compose.sh -- ps

db-generate.sh

Generate a new Alembic database migration. Prompts for a migration message.

./scripts/db-generate.sh

Note: Can run without sudo if your user is in the docker group.

Development only

Used during development to create new migrations. Migrations are applied automatically during startup.

db-migrate.sh

Apply pending Alembic database migrations. Called automatically by start.sh and restart.sh.

sudo /opt/devpush/scripts/db-migrate.sh
Option Description
--timeout <sec> Timeout waiting for database (default: 30s)

install.sh

Install /dev/push on a fresh server. Sets up Docker, creates the system user, clones the repository, generates .env, and installs the systemd service.

curl -fsSL https://install.devpu.sh | sudo bash

Or run directly:

sudo /opt/devpush/scripts/install.sh
Option Description
--repo <url> Git repository URL (default: official repo)
--ref <ref> Git ref to checkout (branch, tag, or commit)
--yes Skip confirmation prompts
--no-telemetry Disable anonymous install telemetry
--verbose Show detailed output

restart.sh

Restart all services. Runs database migrations by default.

sudo /opt/devpush/scripts/restart.sh
Option Description
--no-migrate Skip database migrations

restore.sh

Restore from a backup archive. Can selectively restore database, data directory, or code.

sudo /opt/devpush/scripts/restore.sh --archive /var/backups/devpush/backup.tar.gz
Option Description
--archive <file> Path to backup archive (required)
--no-db Skip database restore
--no-data Skip data directory restore
--no-code Skip code restore
--no-restart Don't restart after restore
--no-backup Don't create backup before restore
--remove-runners Remove runner containers before restoring
--timeout <sec> Timeout for database operations
--yes Skip confirmation prompts
--verbose Show detailed output

Creates a backup first

By default, restore creates a backup of current state before overwriting. Use --no-backup to skip this.

start.sh

Start the stack. Auto-detects development mode on macOS.

sudo /opt/devpush/scripts/start.sh
Option Description
--no-migrate Skip database migrations
--timeout <sec> Health check timeout (default: 120s)
--verbose Show detailed output

status.sh

Show the current status of all services.

./scripts/status.sh

Note: Can run without sudo if your user is in the docker group.

stop.sh

Stop all services.

sudo /opt/devpush/scripts/stop.sh
Option Description
--hard Force stop and remove containers

uninstall.sh

Remove /dev/push from the server. Creates a backup, stops containers, removes Docker resources, and prompts before deleting data.

sudo /opt/devpush/scripts/uninstall.sh
Option Description
--yes Skip confirmation prompts
--skip-backup Skip creating a backup before uninstalling
--no-telemetry Disable anonymous uninstall telemetry
--verbose Show detailed output

update.sh

Update to a new version. Creates a backup, pulls code, runs upgrade hooks, rebuilds containers, and restarts.

sudo /opt/devpush/scripts/update.sh
Option Description
--ref <ref> Target version, branch, or commit (default: latest stable)
--skip-backup Skip pre-update backup
--no-migrate Skip database migrations
--no-telemetry Disable anonymous update telemetry
--yes Skip confirmation prompts
--verbose Show detailed output