Phabalicious

website·Indexed 32 days ago

http://docs.phab.io/

A tool to support deployments and everyday DevOps tasks, providing a way to store instance configurations and manage (docker-based) stacks. It includes features for scaffolding apps, Kubernetes and Docker integration, secret handling, and offsite backups. Documentation covers the fabfile.yaml configuration structure, available phab commands, and version history including releases 3.7, 3.8, and 4.0.3.

Tokens
31.1K
Snippets
207
Records
311
Agent score
53%

What's inside Phabalicious

  1. Overview of Phabalicious task execution

    Phabalicious is a tool that executes shell tasks based on configurations stored in a fabfile.yaml file located in the project root. It abstracts the underlying infrastructure, allowing the same scripts to be applied across different environments including Docker containers, SSH connections, Kubernetes pods, or local shells. Common use cases include deploying code, resetting installations, backing up/restoring data, scaffolding projects, handling SSH tunnels, and triggering webhooks.
  2. Overview of Phabalicious DevOps capabilities

    Phabalicious provides a suite of tools to streamline application deployments and daily DevOps tasks. Key capabilities include:

    • Instance Management: Store all necessary configurations for multiple instances within a project folder.
    • Application Interaction: Perform operations such as resetting, backing up, deploying applications, copying data between instances, or executing custom scripts.
    • Scaffolding: Generate configuration files, initialize new projects, and create or destroy application instances.
    • Hosting Administration: Manage and deploy application stacks using Kubernetes, Docker, or Docker Compose.
    • Artifact-based Deployments: Build applications with all dependencies and push artifacts through the deployment pipeline.
    • Local Development: Support for an optional, Docker-based local development environment compatible with any Docker-based stack.
  3. Inspect host and dockerHost configurations

    The about command displays the configuration for a specific host and its corresponding dockerHost-config. Using the -v flag shows the source of the configuration values.
    phab --config=<your-config> about
    phab --config=<your-config> about -v
  4. Manage secrets and passwords in phabalicious

    Phab 3.6 introduces a secret management system to avoid storing sensitive passwords directly in the fabfile. Secrets are declared globally and resolved at runtime using the replacement pattern %secret.SECRET_ID% within host configurations or scripts.

    Phab resolves secrets in the following order of priority:

    1. Uppercased environment variables (e.g., REGISTRY_PASSWORD or a custom name defined via the env key).
    2. Command line options using --secret ID=VALUE.
    3. Local password file (.phabalicious-credentials).
    4. 1Password CLI (if onePasswordId is set and the user is signed in).
    5. 1Password Connect (if onePasswordVaultId is set and global onePassword config is available).
    6. Interactive user prompt as a last resort.
  5. Define remote hosts in fabfile.yaml

    The hosts section contains definitions for remote hosts, including connection details, folder paths, and environment types. You can verify the final configuration (including defaults) for a specific host using the about command.
    hosts:
      exampleHost:
        host: example.host.tld
        user: example_user
        port: 2233
        type: dev
        info:
          description: An example of a configuration
          publicUrl: http://www.example.com
          category:
            id: 01-example
            label: An example category
        rootFolder: /var/www/public
        gitRootFolder: /var/www
        siteFolder: /sites/default
        filesFolder: /sites/default/files
        backupFolder: /var/www/backups
        supportsInstalls: true
        supportsCopyFrom: true
        branch: develop

    To check host configuration:

    phab --config=staging about

  6. Manage secrets in phabalicious

    Phabalicious allows you to declare secrets that are injected at runtime rather than stored in plain text within a fabfile. This reduces security risks by preventing sensitive data from being deployed to other systems. Secrets can be retrieved from environment variables, .env files, command-line options, 1Password (CLI or Connect), or by prompting the user as a fallback.
  7. Trace configuration inheritance with the about command

    The about command now supports a -v (verbose) flag. When used, it displays the exact file path or source from which each configuration parameter was inherited.
    phab about -v -ctest
  8. Phabalicious Architecture Overview

    Phabalicious is a tooling and setup manager that centralizes project configuration in a fabfile.yaml located in the project root. It abstracts the interaction between applications (e.g., Drupal, Laravel) and their hosting environments (e.g., local, Docker, Kubernetes, remote servers), allowing developers to execute standardized commands regardless of the hosting provider. The system supports configuration inheritance from local and remote files to minimize duplication across teams.
  9. Use Kubernetes (k8s) support in phabalicious

    Phabalicious provides built-in support for Kubernetes (k8s) operations. This includes the ability to execute kubectl commands, manage contexts, and perform deployments. Key capabilities include:

    • Subcommands: Support for describe, logs, rollout (which waits for deployments to finish), and delete.
    • Operations: Implementation of copy operations for k8s.
    • Configuration: Ability to set a dedicated kubeconfig in the fabfile, add options to kubectl commands, and set environment variables (e.g., KUBECONFIG) within the kubectl context.
    • Context Management: Support for switching contexts before running kubectl commands.
  10. Add about sections to scaffolding files

    Since version 3.8.19, scaffolding files can now include an 'about' section for better documentation and description of the scaffold.
  11. Configure Laravel application support

    To enable Laravel support, add laravel to the needs section of the host-config. Phab will then automatically run artisan commands during reset or install. You can customize these commands using the artisanTasks configuration. If a database is required, also add mysql or sqlite to the needs list.
    hosts:
      local:
        needs:
          - sqlite
          - laravel
        artisanTasks:
          reset:
            - config:cache
            - migrate
            - my-custom-artisan-command
            - cache:clear
  12. Install Phabalicious using a published PHAR

    You can install Phabalicious by downloading the latest PHAR release from GitHub and placing it in your system path.
    # Download phabalicious.phar from GitHub releases
    cp phabalicious.phar /usr/local/bin/phab
    chmod u+x /usr/local/bin/phab