coastline

command module
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: Apache-2.0 Imports: 1 Imported by: 0

README

Coastline

The self-service portal to automate the mundane

Go Report Card License

What is Coastline?

Coastline is a web service that enables users to make Requests for predefined Request Templates, that trigger workflows to automate mundane tasks (like giving users access, creating new resources, etc.).

How it works?

how-it-works

The Platform Team defines Request Templates and associated Workflows using CUE, and Coastline provides a web portal for users to login and make Requests (based on the Request Templates).

There is an approval process for Requests, and once approved, the server triggers a workflow.

Who is it for?

Coastline is aimed at Platform Teams who maintain infrastructure and tooling for software teams, to provide a self-service portal for automating mundane tasks.

Goal

The goal of Coastline is to automate simple tasks to provide better developer experience and allow platform teams to focus on things that matter.

Example request

Below is a simple example request and workflow for requesting Cat Facts from: https://catfact.ninja/

package demo

import (
 "encoding/json"
 
 "github.com/verifa/coastline/tasks/http"
)

request: #CatFact: {
 kind:        "CatFact"
 description: "Cat fact max length \(spec.maxLength)"
 serviceSelector: {
  matchLabels: {
   tool: "cat-facts"
  }
 }
 spec: {
  // Max length of cat fact
  maxLength: int | *100
 }
}

workflow: CatFact: {
 input: request.#CatFact

 step: api: http.Get & {
  url: "https://catfact.ninja/fact"
  request: {
   params: {
    max_length: "\(input.spec.maxLength)"
   }
  }
 }

 output: {
  fact: json.Unmarshal(step.api.response.body).fact
 }
}

Run dev server

Coastline's server has a --dev mode which is intended for exploring Coastline without setting anything up.

To give you a quick feel for Coastline, it comes packaged with some demo data to request useful things like:

  1. Cat facts
  2. Pokemon facts

To run a demo environment of Coastline with these capabilities you will need the request templates and workflows available in the demo folder.

git clone https://github.com/verifa/coastline.git

# Build from source and run coastline
# TODO: add docs to download and run from binary: https://github.com/verifa/coastline/releases
# TODO: add docs on running from Docker: https://hub.docker.com/r/verifa/coastline
make build run

# Go to http://localhost:3000
# Login (without credentials in dev mode)
# Explore and enjoy, and don't forget to tell us what you learnt :)

Terminology

Request Template - A request template is written in CUE and defines the specification (i.e. inputs/parameters) for a Request which users can make

Request - A request is made by users according to a specific Request Template

Trigger - A trigger is automatically created when a Request is approved

Workflow - A workflow is written in CUE and defines what should happen when a trigger for a Request is made

Task - Workflows execute tasks that actually do something (like making HTTP requests)

License

This code is released under the Apache-2.0 License.

Documentation

Overview

Copyright © 2022 Jacob Larfors <jlarfors@verifa.io>

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Directories

Path Synopsis
ent

Jump to

Keyboard shortcuts

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