go-excusegen

command module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2020 License: MIT Imports: 12 Imported by: 0

README

Xkcd 303 programmer's excuse generator

Simple image generator in Go, based on XKCD's famous compiling comic.

Note: This is a fork of upstream based on commit 5d81580 without the imgur feature. Code has been refreshed with Docker and GitLab CI/CD pipelines.

Requirements

  • Docker or GitLab CI/CD

How to use

Define the image.

$ IMAGE=registry.gitlab.com/gitlab-de/go-excusegen:latest

Pull the container.

$ docker pull $IMAGE

Run the container to generate the GitLab is down image by default in out/gitlab.png.

$ docker run -ti --rm -v $PWD/out:/app/out $IMAGE

$ open out/gitlab.png

example-excuse

You can customize the output with using -long, -short and -out parameters for the /app/go-excusegen binary. This overrides the default CMD entrypoint in the Docker container.

docker run -ti --rm -v $PWD/out:/app/out $IMAGE /app/go-excusegen -long "AWS is down" -short "AWS down" -out out/aws.png

Development

Docker

$ IMAGE=go-excusegen

$ docker built -t $IMAGE .

$ docker run -ti --rm -v $PWD/out:/app/out $IMAGE

Source

Requires a local Go build environment, e.g. with Homebrew on macOS.

$ go get ./...
$ go build ./...
$ ./go-excusegen -help
Usage of ./go-excusegen:
  -long string
    	long text for the excuse (default "compiling my code")
  -out string
    	Path to the generated PNG file. Defaults to out/out.png (default "out/out.png")
  -short string
    	short text for the excuse (default "compiling")

License

This software is distributed under the terms of the MIT license. See LICENSE for details.

Credit

Graphic resources (image & font) by XKCD

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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