launchr

package module
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 15 Imported by: 19

README

Launchr

Launchr is a CLI action runner that executes actions inside short-lived local containers.
Actions are defined in action.yaml files, which are automatically discovered in the filesystem. They can be placed anywhere that makes sense semantically. You can find action examples here and in the documentation.
Launchr has a plugin system that allows to extend its functionality. See core plugins, compose and documentation.

Table of contents

Usage

Build launchr from source locally. Build dependencies:

  1. go >=1.20, see installation guide
  2. make

Build the launchr tool:

make
bin/launchr --help

The documentation for launchr usage can be found in docs.

If you face any issues with launchr:

  1. Open an issue in the repo.
  2. Share the app version with launchr --version

Installation

Installation from source

Build dependencies:

  1. go >=1.20, see installation guide
  2. make

Global installation

Install launchr globally:

make install
launchr --version

The tool will be installed in $GOPATH/bin which is usually ~/go/bin.
If GOPATH env variable is not available, make sure you have it in ~/.bashrc or ~/.zhrc:

export GOPATH=`go env GOPATH`
export PATH=$PATH:$GOPATH/bin

Local installation

The tool can be built and run locally:

make
bin/launchr --version

Development

The launchr can be built with a make to bin directory:

make

It is also supported to make a build to use with dlv for debug:

make DEBUG=1

Useful make commands:

  1. Fetch dependencies - make deps
  2. Test the code - make test
  3. Lint the code - make lint

Publishing a new release

  1. Install goreleaser
  2. Create an Access token on GitHub
  3. Create a tag, build a release and push
    git tag -a v0.0.0 -m "Release notes"
    export GITHUB_TOKEN="[TOKEN]"
    goreleaser release --clean
    

Documentation

Overview

Package launchr has application implementation.

Index

Constants

View Source
const (
	// PkgPath is a main module path.
	PkgPath = launchr.PkgPath
)

Variables

View Source
var ActionsGroup = &cobra.Group{
	ID:    "actions",
	Title: "Actions:",
}

ActionsGroup is a cobra command group definition

Functions

func EnsurePath added in v0.0.9

func EnsurePath(parts ...string) error

EnsurePath creates all directories in the path.

func Gen

func Gen() int

Gen generates application specific build files and returns os exit code.

func GetFsAbsPath added in v0.0.9

func GetFsAbsPath(fs fs.FS) string

GetFsAbsPath returns absolute path for an FS struct.

func RegisterPlugin

func RegisterPlugin(p Plugin)

RegisterPlugin add a plugin to global pull.

func Run

func Run() int

Run executes launchr application.

Types

type ActionDiscoveryPlugin added in v0.5.4

type ActionDiscoveryPlugin = action.DiscoveryPlugin

ActionDiscoveryPlugin is an interface to implement a plugin to discover actions.

type App

type App = launchr.App

App stores global application state.

type AppVersion

type AppVersion = launchr.AppVersion

AppVersion stores application version.

func Version

func Version() *AppVersion

Version provides app version info.

type CobraPlugin

type CobraPlugin = launchr.CobraPlugin

CobraPlugin is an interface to implement a plugin for cobra.

type Config added in v0.1.0

type Config = launchr.Config

Config handles application configuration.

type ConfigAware added in v0.1.0

type ConfigAware = launchr.ConfigAware

ConfigAware provides an interface for structs to support launchr configuration setting.

type GeneratePlugin

type GeneratePlugin = launchr.GeneratePlugin

GeneratePlugin is an interface to generate supporting files before build.

type ManagedFS added in v0.5.5

type ManagedFS = launchr.ManagedFS

ManagedFS is a File System managed by launchr.

type OnAppInitPlugin added in v0.1.0

type OnAppInitPlugin = launchr.OnAppInitPlugin

OnAppInitPlugin is an interface to implement a plugin for app initialisation.

type Plugin

type Plugin = launchr.Plugin

Plugin is a common interface for launchr plugins.

type PluginGeneratedData

type PluginGeneratedData = launchr.PluginGeneratedData

PluginGeneratedData is a struct containing a result information of plugin generation.

type PluginInfo

type PluginInfo = launchr.PluginInfo

PluginInfo provides information about the plugin and is used as a unique data to indentify a plugin.

type PluginManager added in v0.0.8

type PluginManager = launchr.PluginManager

PluginManager handles plugins.

type Service added in v0.0.8

type Service = launchr.Service

Service is a common interface for a service to register.

type ServiceInfo added in v0.0.8

type ServiceInfo = launchr.ServiceInfo

ServiceInfo provides service info for its initialization.

Directories

Path Synopsis
cmd
launchr
Package executes Launchr application.
Package executes Launchr application.
launchr/gen
Package gen is here to provide example structure for the built app.
Package gen is here to provide example structure for the built app.
internal
launchr
Package launchr provides common app functionality.
Package launchr provides common app functionality.
pkg
action
Package action provides implementations of discovering and running actions.
Package action provides implementations of discovering and running actions.
cli
Package cli implements printing functionality for CLI output.
Package cli implements printing functionality for CLI output.
driver
Package driver hold implementation for action drivers.
Package driver hold implementation for action drivers.
driver/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
jsonschema
Package jsonschema has functionality related to json schema support.
Package jsonschema has functionality related to json schema support.
log
Package log is meant to provide a global logger for the application and provide logging functionality interface.
Package log is meant to provide a global logger for the application and provide logging functionality interface.
types
Package types contains launchr common types.
Package types contains launchr common types.
Package plugins provides launchr core plugins.
Package plugins provides launchr core plugins.
builder
Package builder implements launchr functionality to build itself.
Package builder implements launchr functionality to build itself.
verbosity
Package verbosity is a plugin of launchr to configure log level of the app.
Package verbosity is a plugin of launchr to configure log level of the app.
yamldiscovery
Package yamldiscovery implements a launchr plugin to discover actions defined in yaml.
Package yamldiscovery implements a launchr plugin to discover actions defined in yaml.
yamldiscovery/embed
Package embed provides yaml discovery with embed actions definition.
Package embed provides yaml discovery with embed actions definition.

Jump to

Keyboard shortcuts

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