warp

module
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2020 License: MIT

README

warp: Yet another deployment wrapper 🚀

CircleCI GoDoc Coverage Status Go Report Card

warp is yet another command-line interface for deploying Kubernetes stacks. The approach is very similar to Skaffold, but warp is specifically tailored to end-to-end testing. It is a tiny wrapper (warper?) to develop and perform end-to-end tests, at warp seed. 🚀

warp is useful when you want to manage more than one deployment of a stack. This arises when you have multiple software engineers working on the same project, or an undetermined number of parallel jobs running in Continuous Integration. warp uses name_manager to minimize the number of stacks that need to be deployed.

Stacks are deployed and tested according to pipelines. These pipelines give all the steps to deploy the stack, all the tools to launch during local development (file syncing, port forwarding, webapp live reload, ...), and all the end-to-end tests to run.

The end-to-end tests and local development tools are automatically passed environment variables to connect to the stack. Performing end-to-end tests on a test stack is greatly simplified. For instance, this would be the pipeline to perform Cypress browser tests on a web app:

# stack identifies the stacks managed by this pipeline.
# Stacks either have a fixed name (typical for production stacks),
# or a name built from a fixed component (the "family" name) and a variable 
# component (the "short" name).  The short name is automatically generated.
stack:
  family: my-web-app
deploy:
  # kustomize instructs the pipeline to deploy the stack using Kustomize.
  kustomize:
    # path is the path to the Kustomize configuration.
    # "kustomize/base/kustomization.yml" would be a file referencing all
    # the Kubernetes resources to deploy and the kustomizations to apply.
    path: kustomize/base
# commands lists all the commands that can be executed against the stack.
commands:
- name: test
  description: Non-interactive testing using Cypress.
  env:
    # If the frontend is implemented as a Kubernetes service named
    # frontend and its pods serve the frontend on port 8080, the
    # template would expand to, e.g., "127.0.0.1:57689", where
    # 57689 is a random port.  In the background, warp forwards
    # the 8080 port of a pod to this local random port.
    # The port forwarding ends when the test completes.
    - 'CYPRESS_baseUrl=http://{{ serviceAddress "frontend" 8080 }}'
  workingDir: frontend
  command: ['yarn', 'cypress', 'run']
- name: open
  descripton: Interactive testing using Cypress.
  env:
    - 'CYPRESS_baseUrl=http://{{ serviceAddress "frontend" 8080 }}'
    workingDir: frontend
    command: ['yarn', 'cypress', 'open']

To run all the tests, if the above pipeline is in pipeline.yml, use warp pipeline.yml --run test --tail (--tail follows the stdout/stderr of all the containers in the stack). To develop or debug tests, run warp pipeline.yml --run open --tail.

It doesn't get simpler than that. 🏖

Because pipelines can inherit the steps of other, base pipelines, it is possible to have an overlay organization that would mimic how project are organized with Kustomize. For instance, you could have a base folder container a base pipeline.yml and kustomization.yml, a dev folder containing configurations for a "dev" stack with file synchronization and the ability to manage multiple stacks, and a prod folder containing the configuration for the production stack.

warp can be either consumed as a Go package or through a standalone Command-Line Interface (CLI). It is continuously tested on Linux, Mac OSX, and Windows.

License

warp is licensed under The MIT License.

FOSSA Status

Directories

Path Synopsis
cmd
examples
batch
SPDX-License-Identifier: MIT Copyright (c) 2019 Hadrien Chauvin
SPDX-License-Identifier: MIT Copyright (c) 2019 Hadrien Chauvin
dev
env
gc
SPDX-License-Identifier: MIT Copyright (c) 2019 Hadrien Chauvin
SPDX-License-Identifier: MIT Copyright (c) 2019 Hadrien Chauvin
pkg
batches
Package batches defines the content of a Batch definition file.
Package batches defines the content of a Batch definition file.
config
Package config provides TOML-based configuration for warp (.warprc.toml).
Package config provides TOML-based configuration for warp (.warprc.toml).
deploy
Package deploy implements the "deploy" steps of pipelines.
Package deploy implements the "deploy" steps of pipelines.
deploy/container
Package container implements deployment operations performed on the containers themselves.
Package container implements deployment operations performed on the containers themselves.
deploy/helm
Package helm implements kustomize-based Kubernetes deployment.
Package helm implements kustomize-based Kubernetes deployment.
deploy/kustomize
Package kustomize implements kustomize-based Kubernetes deployment.
Package kustomize implements kustomize-based Kubernetes deployment.
dev
Package dev implements the "dev" steps of pipelines.
Package dev implements the "dev" steps of pipelines.
dev/browsersync
Package browsersync implements browser-sync live reload of web pages.
Package browsersync implements browser-sync live reload of web pages.
dev/ksync
Package ksync implements file synchronization between the local file system and Kubernetes pods.
Package ksync implements file synchronization between the local file system and Kubernetes pods.
dev/portforward
Package portforward implements port forwarding for development purposes.
Package portforward implements port forwarding for development purposes.
k8s
Package k8s implements Kubernetes-specific code.
Package k8s implements Kubernetes-specific code.
log
Package log implements logging.
Package log implements logging.
pipelines
Package pipelines defines the pipeline API.
Package pipelines defines the pipeline API.
proc
Package proc extends the standard exec package to deal with processes in a more graceful way.
Package proc extends the standard exec package to deal with processes in a more graceful way.
run
Package run implements the "run" step of pipelines.
Package run implements the "run" step of pipelines.
run/batch
Package batch implements batch execution.
Package batch implements batch execution.
run/env
Package env implements environment variable templating.
Package env implements environment variable templating.
stacks
Package stacks implements the acquisition and release of stacks, using name_manager.
Package stacks implements the acquisition and release of stacks, using name_manager.
stacks/names
Package names deals with stack names.
Package names deals with stack names.
tags
Package tags implements tag-based filtering.
Package tags implements tag-based filtering.
telemetry
Package telemetry implements telemetry to monitor the usage of the Command-Line Interface.
Package telemetry implements telemetry to monitor the usage of the Command-Line Interface.
telemetry/mongo
Package mongo implements telemetry on top of MongoDB.
Package mongo implements telemetry on top of MongoDB.

Jump to

Keyboard shortcuts

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