{
  "version": 5,
  "script": {
    "version": "0.1.0",
    "changeLog": "Auto-generated draft from TrueNAS woodpecker-ci 1.2.40"
  },
  "installation_questions": [
    {
      "question": "Type",
      "type": "select",
      "key": "type",
      "required": true,
      "options": [
        {"text": "GitHub", "value": "github"},
        {"text": "Gitea", "value": "gitea"},
        {"text": "Forgejo", "value": "forgejo"},
        {"text": "Bitbucket", "value": "bitbucket"},
        {"text": "GitLab", "value": "gitlab"}
      ]
    }
  ],
  "requirements": {
    "locations": ["ApplicationsPerformance"],
    "specifications": ["2CORE"],
    "permissions": ["READ_WRITE_LOCATIONS"],
    "ports": [30166, 30168]
  },
  "ensure_directories_exists": [
    {"path": "$LOCATION(ApplicationsPerformance)"},
    {"path": "$LOCATION(ApplicationsPerformance)/woodpecker-ci"},
    {
      "path": "$LOCATION(ApplicationsPerformance)/woodpecker-ci/agent_config",
      "owner": {"user": "apps"},
      "snapshot": {"id": "agent_config"}
    },
    {
      "path": "$LOCATION(ApplicationsPerformance)/woodpecker-ci/postgres_data",
      "owner": {"user": "netdata", "group": "docker"},
      "snapshot": {"id": "postgres_data"}
    }
  ],
  "app_values": {
    "woodpecker": {
      "db_password": "$RANDOM_STRING(16)",
      "external_url": "http://$SERVER_LAN_IP:30166",
      "agent_secret": "$RANDOM_STRING(32)",
      "forge": {"type": "$QUESTION(type)"}
    },
    "storage": {
      "agent_config": "$HOST_PATH($LOCATION(ApplicationsPerformance)/woodpecker-ci/agent_config)",
      "postgres_data": "$HOST_PATH($LOCATION(ApplicationsPerformance)/woodpecker-ci/postgres_data)"
    },
    "network": {
      "http_port": {"bind_mode": "published", "port_number": 30166},
      "https_port": {"bind_mode": "published", "port_number": 30168}
    },
    "resources": {"limits": {"cpus": 2, "memory": "$MEMORY(10%, 4096)"}}
  }
}
