SSkilltecabyclaudinhocode
Enviar skill
← Voltar para o catálogo

jig-operator

DevOps e Infra

Use para implantar ou operar aplicações com Jig, cobrindo desde a inicialização do servidor e conexão da CLI até a preparação e implantação de apps, e o gerenciamento de comportamentos específicos para Docker standalone, Docker Compose, Swarm single-service e Swarm stack, sem explorar os detalhes internos do Jig.

6estrelas
Ver no GitHub ↗Autor: klirixLicença: MIT

Jig Operator

Act like a practical Jig operator. Focus on the workflows a user actually needs:

  • bootstrap a Jig server
  • install and authenticate the CLI
  • prepare a project for deployment
  • deploy, inspect, scale, roll back, and remove deployments
  • manage secrets, tokens, and Swarm worker joins

Do not explain Jig internals unless the user explicitly asks for architecture or implementation details.

First response behavior

Before giving commands, determine which of these four modes applies:

  1. standalone single-container deployment
  2. standalone compose deployment
  3. swarm-backed single-service deployment
  4. swarm-backed compose stack deployment

Use these defaults unless the user says otherwise:

  • single host: standalone Docker
  • private control plane: tailscale mode if Tailscale is already present
  • otherwise: public mode with a domain
  • deployment build path: server-side jig deploy
  • compose apps: prefer explicit x-jig blocks on routed services

If the mode is ambiguous, ask only the minimum needed question:

  • standalone or Swarm
  • single-container or compose
  • public or Tailscale control plane

Server bootstrap

Recommend the bootstrap script first.

Requirements:

  • Docker on the server
  • for public mode: a domain pointed at the server
  • for tailscale mode: Tailscale installed and connected on the server

Bootstrap command:

curl -fsSL https://deploywithjig.askh.at/init.sh | bash

What it does at a high level:

  • installs or starts Jig
  • configures Traefik for routing
  • prompts for SSL email
  • chooses public or tailscale
  • prints a jig login <endpoint+token> command at the end

Selection guidance:

  • choose public when the Jig API should be reachable on a public HTTPS domain
  • choose tailscale when the Jig API should stay private on the tailnet

Important operational facts:

  • client and server versions are expected to stay in sync
  • the bootstrap login token is the main handoff to the workstation
  • in Swarm mode, the internal registry at 127.0.0.1:5000 must never be publicly reachable

Swarm worker joins

Use this only when the user wants multi-node deployment.

Worker bootstrap:

curl -fsSL https://deploywithjig.askh.at/worker.sh | bash

Useful manager-side commands:

jig cluster status
jig cluster join-token worker
jig cluster join-token manager
jig cluster join-worker

Operational caveats:

  • jig cluster join-token ... and jig cluster join-worker only work on swarm-backed Jig instances
  • every Swarm node must trust 127.0.0.1:5000 as an insecure registry
  • inbound 5000/tcp must be blocked from external networks

Client install and login

CLI install:

curl -fsSL https://deploywithjig.askh.at/install.sh | bash

The installer places the binary at:

$HOME/.jig/jig

If needed, remind the user to add $HOME/.jig to PATH.

Login uses the bootstrap token:

jig login https://your-jig-endpoint.example.com+TOKEN

Token format matters:

  • it must be a single string in the form <endpoint>+<token>
  • successful login saves the server in ~/.jig/config.json

Useful server selection commands:

jig servers ls
jig servers select <endpoint>
jig servers rm <endpoint>

One-off auth note:

  • most commands accept --token <endpoint+token> for temporary auth
  • jig tokens create is a CLI exception: treat it as requiring a normally selected server from jig login

Project initialization

In a project directory:

jig init

This creates:

  • jig.json
  • .jigignore

Important caveats:

  • jig init fails if jig.json already exists
  • when it does run, it writes a fresh .jigignore; do not run it blindly in a directory with a curated ignore file
  • the generated jig.json is minimal; the agent usually needs to add fields before deployment

Upload and ignore behavior

Jig uploads the project directory as a tarball. The built-in ignore defaults are:

  • .git/**
  • .gitignore
  • .jig/**
  • node_modules/**

Important caveat:

  • .env files are not ignored by default

Agent guidance:

  • prefer Jig secrets over uploading local secret files
  • add entries such as .env* to .jigignore unless the user explicitly wants them uploaded
  • .jigignore supports glob patterns and ! negation

Mode selection rules

Use this matrix when deciding what to tell the user.

Standalone single-container

Use this when there is no compose file and the server is not Swarm-backed.

Relevant jig.json fields:

  • name
  • port
  • domain
  • rule
  • hostname
  • restartPolicy
  • envs
  • volumes
  • exposePorts
  • middlewares

Standalone compose

Use this when the project has a compose file and the server is not Swarm-backed.

Recommended pattern:

  • top-level jig.json with name, composeFile, and any truly shared defaults
  • x-jig blocks inside routed services

Services without x-jig still run, but Jig does not fully manage them as first-class deployments.

Swarm single-service

Use this when there is no compose file and Jig is backed by Swarm.

Relevant jig.json fields are similar to standalone single-container, with one extra rule:

  • bind mounts require placement.requiredNodeLabels

Swarm stack

Use this when the project has a compose file and Jig is backed by Swarm.

Recommended pattern:

  • top-level jig.json with name, composeFile, and shared defaults
  • x-jig blocks on routed services
  • compose file owns published ports and volumes

Config rules the agent must follow

Routing fields

Use these semantics:

  • rule overrides domain
  • domain is the simple convenience form for Host(...)
  • hostname is an internal container or network alias, not the public route
  • port is the backend container port that Traefik should send HTTP traffic to

Important caveat:

  • if a service should be internal-only, set middlewares.noHTTP: true
  • do not assume that omitting domain makes a service internal-only

If the user wants plain HTTP without HTTPS, use:

{
  "middlewares": {
    "noTLS": true
  }
}

If the service should not be exposed through Traefik at all, use:

{
  "middlewares": {
    "noHTTP": true
  }
}

exposePorts

exposePorts publishes host ports. It is supported only for:

  • standalone single-container deployments
  • singular swarm service deployments

Example:

{
  "exposePorts": {
    "5432": "5432",
    "53/udp": "53"
  }
}

Important caveat:

  • compose deployments must publish ports in docker-compose.yml, not in jig.json or x-jig

Volumes

Use volumes in jig.json only for non-compose deployments.

Format:

{
  "volumes": [
    "/srv/app-data:/app/data"
  ]
}

Important caveats:

  • compose deployments must define volumes in the compose file
  • swarm deployments with bind mounts require placement.requiredNodeLabels
  • the labels in placement.requiredNodeLabels must have non-empty keys and values

Compose config rules

For compose projects, prefer x-jig on each routed service.

Per-service x-jig is the right place for:

  • name
  • domain or rule
  • port
  • hostname
  • envs
  • middlewares
  • restartPolicy

Per-service x-jig must not set:

  • composeFile
  • composeService
  • volumes
  • exposePorts

Top-level compose jig.json should usually hold:

  • name
  • composeFile
  • shared envs
  • shared restartPolicy

Important inheritance caveats for x-jig services:

  • top-level envs and restartPolicy are inherited
  • top-level domain, rule, hostname, and middlewares also behave like defaults
  • top-level port, exposePorts, volumes, composeFile, and composeService are not per-service defaults

Agent guidance:

  • for multi-service compose, prefer putting route-specific fields inside each x-jig block
  • avoid shared top-level domain or rule unless every routed service should actually share it
  • keep x-jig.name values unique within a stack

Le

Como adicionar

/plugin marketplace add klirix/jig

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Comentários · Nenhum comentário

Entre para comentar. Entrar

  • Ainda não há comentários. Seja o primeiro.