WakeMeOps

repository·main·Indexed 41 days ago

https://github.com/upciti/wakemeops

A Debian repository for portable DevOps, Dev, SecOps, and Terminal tools. It provides versioned packages via apt, Docker base images (debian, ubuntu, minideb), and the upciti/wakemeops-action@v1 GitHub Action to ensure reproducible environments for CI/CD and local development.

Tokens
2.2K
Snippets
13
Records
14
Agent score
53%

What's inside WakeMeOps

  1. Install WakeMeOps packages on Debian/Ubuntu

    main

    To install packages from the WakeMeOps repository on a terminal, follow these two steps:

    1. Add the WakeMeOps repository to your system:

      curl -sSL https://raw.githubusercontent.com/upciti/wakemeops/main/assets/install_repository | sudo bash
    2. Install the specific package using apt:

      sudo apt install <package_name>
    curl -sSL https://raw.githubusercontent.com/upciti/wakemeops/main/assets/install_repository | sudo bash
    sudo apt install <package_name>
  2. Install the WakeMeOps repository on a terminal

    main

    To use WakeMeOps to install portable applications via apt on your local machine, first add the repository using the provided installation script. Once added, you can install packages directly or specify versions to ensure reproducibility.

    # Add WakeMeOps repository
    curl -sSL https://raw.githubusercontent.com/upciti/wakemeops/main/assets/install_repository | sudo bash
    
    # Now you can install packages from WakeMeOps
    sudo apt install bat fd dust exa gping
    sudo apt install pyenv=2.2.* poetry=1.1.*
    sudo apt install helm=3.7.3 kustomize=4.4.* kubectl=1.23.1
  3. Pin package versions with wildcards

    main

    You can install specific versions of a package using the <package>=<version> syntax.

    Important: WakeMeOps only keeps the latest revision of each package. To prevent CI pipelines from breaking when a package revision (the number after the last hyphen, e.g., 1.23.1-1~ops2deb) changes, always use a wildcard to allow for the latest revision.

    Recommended usage for CI:

    sudo apt install "kubectl=1.23.1*"

    Other examples:

    • sudo apt install "kubectl=1.22*" (Matches any 1.22.x version)
    • sudo apt install "kubectl=1*" (Matches any 1.x.x version)
    • sudo apt install "kubectl=1.23.1*" (Matches exact application version with any revision)
    sudo apt install "kubectl=1.23.1*"
  4. Add the WakeMeOps repository

    main

    To use WakeMeOps packages, you must first add the repository to your system. You can choose to install all components or only the terminal-specific goodies.

    1. Install all components:

      curl -sSL https://raw.githubusercontent.com/upciti/wakemeops/main/assets/install_repository | sudo bash
    2. Install terminal goodies only:

      curl -sSL https://raw.githubusercontent.com/upciti/wakemeops/main/assets/install_repository | sudo bash -s terminal

    After adding the repository, always update your APT cache:

    sudo apt-get update
    curl -sSL https://raw.githubusercontent.com/upciti/wakemeops/main/assets/install_repository | sudo bash
  5. How to add new packages to WakeMeOps

    main

    WakeMeOps uses a GitOps approach where Debian packages are generated from ops2deb configuration files. To contribute a new package:

    1. Install ops2deb.
    2. Add a new configuration file at ./blueprints/{component}/{application_name}/ops2deb.yml.
    3. Run make format to format the YAML.
    4. Run make lock to update the lock files.
    5. Submit a pull request using conventional commits.

    Note for Apple arm64 users: If you are on an Apple Silicon Mac, use the following Docker command to run the formatting and locking process in an amd64 environment:

    docker run --platform linux/amd64 --workdir /home/ops2deb --volume ./:/home/ops2deb --rm \
      docker.io/wakemeops/debian /bin/bash -c "apt update && apt install -y make ops2deb && make format && make lock"
  6. Use WakeMeOps in a Dockerfile

    main

    You can use WakeMeOps to create concise and reproducible Docker images by using the wakemeops/debian base image. Instead of manual downloads, use the install_packages command to specify the tools and versions you need.

    FROM wakemeops/debian:bullseye
    
    RUN install_packages \
        helm=3.7.2* \
        kustomize=4.4.1* \
        kubectl=1.23.1*
    
    USER 1001
  7. Configure WakeMeOps repository priority

    main

    By default, Debian/Ubuntu repositories have a priority of 500. You can adjust the WakeMeOps repository priority to control whether APT prefers WakeMeOps packages or your distribution's packages.

    • Set a low priority: Use this to give your distribution precedence over WakeMeOps (even if WakeMeOps has a higher version number).

      curl -sSL https://raw.githubusercontent.com/upciti/wakemeops/main/assets/set_repository_priority | sudo bash -s 100
    • Set a high priority: Use this to ensure WakeMeOps packages are preferred.

      curl -sSL https://raw.githubusercontent.com/upciti/wakemeops/main/assets/set_repository_priority | sudo bash -s 900

    You can verify current priorities using apt-cache policy.

    curl -sSL https://raw.githubusercontent.com/upciti/wakemeops/main/assets/set_repository_priority | sudo bash -s 100
  8. Add a WakeMeOps package badge to documentation

    main

    You can display a status badge for a WakeMeOps package in your documentation using Markdown, HTML, or RST. Replace {{ site_url }} with the actual site URL and {{ package.name }} with the package name.

    ### Markdown
    ```markdown
    [![WakeMeOps]({{ site_url }}badges/{{ package.name }}.svg)]({{ site_url }}packages/{{ package.name }})

    HTML

    <a href="{{ site_url }}packages/{{ package.name }}">
      <img src="{{ site_url }}badges/{{ package.name }}.svg"/>
    </a>

    RST

    .. image:: {{ site_url }}badges/{{ package.name }}.svg
    :target: {{ site_url }}packages/{{ package.name }}
  9. Use WakeMeOps packages in GitHub Actions

    main

    To install WakeMeOps packages during a CI/CD workflow, use the upciti/wakemeops-action@v1 action. Provide the package name and version in the packages input.

    - name: Install dependencies
      uses: upciti/wakemeops-action@v1
      with:
        packages: |
          <package_name>=<version>*
  10. Use WakeMeOps packages in a Dockerfile

    main

    You can install WakeMeOps packages in a Docker image using the install_packages command within a wakemeops/minideb:bookworm base image. This allows you to pin specific versions using a wildcard pattern.

    FROM wakemeops/minideb:bookworm
    
    RUN install_packages \
        <package_name>=<version>*
    
    USER 1001
  11. Write Dockerfiles using install_packages

    main

    WakeMeOps Docker images include a helper script called install_packages. This script wraps apt-get install, performing an apt-get update, handling retries, and cleaning up /var/lib/apt/lists and /var/cache/apt/archives automatically to keep images slim.

    Example: Precise version pinning (Recommended for stability)

    FROM wakemeops/debian:bookworm
    
    RUN install_packages \
        helm=3.7.2* \
        kustomize=4.4.1* \
        kubectl=1.23.1*
    
    USER 1001

    Example: Latest versions (For rapid development)

    FROM wakemeops/debian:latest
    
    RUN install_packages helm kustomize kubectl
    FROM wakemeops/debian:bookworm
    
    RUN install_packages \
        helm=3.7.2* \
        kustomize=4.4.1* \
        kubectl=1.23.1*
    
    USER 1001