pygmy

command module
v0.12.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 1 Imported by: 0

README

Pygmy

Stability goreleaser Go Report Card GoDoc

This is an application written in Go which is a proposed replacement for Pygmy currently written in Ruby. The goal is to provide a better cross-platform experience for various users running Lagoon, as well as much greater control over configuration options via YAML.

Please see the existing Pygmy documentation for more information about Pygmy as this is designed to be a drop-in replacement.

Early testing

We welcome testers of this tool. You will probably be an existing user of Pygmy who can verify the same functionality, or perhaps who has had trouble installing Pygmy in the past on Windows.

Is Pygmy running?

These instructions will currently install the new version as pygmy so that the old version is still available if you have installed it. With no Pygmy running, you should get "connection refused" when attempting to connect to the local amazee network.

curl --HEAD http://myproject.docker.amazee.io
curl: (7) Failed to connect to myproject.docker.amazee.io port 80: Connection refused

Installation

These instructions will build Linux, MacOS and Windows binaries of Pygmy on MacOS, and then test the MacOS version. M1 and arm64 images are available and supported

Using Homebrew

Homebrew is the recommended way to install pygmy and keep it up to date on compatible systems.

Works for: Linux & MacOS (also WSL-based systems)

brew tap pygmystack/pygmy;
brew install pygmy;
Compile from source

Ensure to select the correct build for your OS and architecture in the cp command.

Works for: Linux, MacOS & Windows

git clone https://github.com/pygmystack/pygmy.git && cd pygmy;
make build;
cp ./builds/pygmy-darwin /usr/local/bin/pygmy;
chmod +x /usr/local/bin/pygmy;

Pygmy is now executable as pygmy. Now start Pygmy and use the new status command. If you still need to use the previous pygmy, cp the binary to a different name (e.g. pygmy-go)

Using the AUR

Works for: Arch-based Linux Distributions (Manjaro, Elementary, ArcoLinux etc)

pygmy, pygmy-bin and pygmy-git are available via the Arch User Repository for Arch-based Linux distributions on the community stream. Unfortunately, Pygmy is not yet available via other distribution methods, so it is otherwise recommended to use homebrew to install it, download a pre-compiled binary from the releases page, or to compile from source.

# Freshly compile the latest release:
yay -S pygmy;
# Download the latest release precompiled:
yay -S pygmy-bin;
# Download and compile the latest HEAD from GitHub on the main branch:
yay -S pygmy-git;

Usage

If you have an Amazee Lagoon project running, you can test the web address and expect a HTTP/1.1 200 OK response.

$ curl --HEAD http://myproject.docker.amazee.io
HTTP/1.1 200 OK
Server: openresty
Content-Type: text/html; charset=UTF-8
Cache-Control: must-revalidate, no-cache, private
Date: Mon, 11 Nov 2019 11:19:29 GMT
X-UA-Compatible: IE=edge
Content-language: en
X-Content-Type-Options: nosniff
X-Frame-Options: SAMEORIGIN
X-Drupal-Cache-Tags: config:honeypot.settings config:system.site config:user.role.anonymous http_response rendered
X-Drupal-Cache-Contexts: languages:language_interface theme url.path url.query_args user.permissions user.roles:authenticated
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Vary:
X-Frame-Options: SameOrigin

If your project is not running you should expect a 503 response:

$ curl --HEAD http://FUBARNOTINDAHOUSE.docker.amazee.io
HTTP/1.0 503 Service Unavailable
Cache-Control: no-cache
Connection: close
Content-Type: text/html

Thanks for testing, please post issues and successes in the queue.

Local development

To run full regression tests locally, you can follow this process if you have cmake, git and go installed. This will prevent a significant amount of build failures and problems after committing.

It will use dind and your local daemon to walk through several tests which should pass.

  1. First clone the project:
    git clone https://github.com/pygmystack/pygmy.git pygmy && cd pygmy
    
  2. Perform any updates as required.
  3. Clean the environment.
    go run main.go clean
    
  4. Build the project.
    make
    
  5. Test the project prior to commiting.
    go test -v
    

Releasing

We use GitHub Actions for simulating the automated release tagging locally. Using Act locally, you can simulate this process and have the same build artifacts in your dist folder. This process will inject the appropriate values into the version logic. To start the process, just run act!

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
service
endpoint
Package endpoint provides a way to test a HTTP/HTTPS endpoint for a 200 response code.
Package endpoint provides a way to test a HTTP/HTTPS endpoint for a 200 response code.
library
Package library is a package which exposes the commands externally to the compiled binaries.
Package library is a package which exposes the commands externally to the compiled binaries.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL