Skip to content

Latest commit

 

History

History
145 lines (106 loc) · 5.12 KB

README.md

File metadata and controls

145 lines (106 loc) · 5.12 KB

Go Report Card Build status Go Reference License: Apache 2.0 Quality Gate Status

Openlane Cloud

Building a SaaS offering on top of Openlane

Openlane Cloud Server

The Openlane Cloud server is used to consume the openlane server and apply an opinionated implementation on top of the the generics provided. Many, if not all, of the endpoints provided by the server use the openlane client to make requests to the openlane Server.

As an example, the v1/organizations endpoint uses the openlane client to create an organizational hierarchy`:

│   └── rootorg <--- top level organization
│       ├── production <-- top level environment per customer organization
│       │   ├── assets <-- buckets
│       │   ├── customers
│       │   ├── orders
│       │   ├── relationships
│       │   │   ├── internal_users  <-- relationships
│       │   │   ├── marketing_subscribers
│       │   │   ├── marketplaces
│       │   │   ├── partners
│       │   │   └── vendors
│       │   └── sales
│       └── test <-- organization identical to production just named

Openlane Cloud CLI

The openlane cloud cli is used to interact with the openlane cloud server as well as some requests directly to the openlane server using the openlane client. In order to use the cli, you must have a registered user with the openlane server.

Installation

brew install theopenlane/tap/openlane-cloud

Upgrade

brew upgrade theopenlane/tap/openlane-cloud

Usage

openlane-cloud
the openlane-cloud cli

Usage:
  openlane-cloud [command]

Available Commands:
  completion     Generate the autocompletion script for the specified shell
  help           Help about any command
  seed           the subcommands for creating demo data in openlane
  organization   the subcommands for working with the openlane organization

Seeding Data

The openlane-cloud cli has functionality to generate and load test data into openlane using the seed command.

Usage:
  openlane-cloud seed [command]

Available Commands:
  generate    generate random data for seeded environment
  init        init a new openlane seeded environment

Using the Taskfile

On a brand new database, you should run:

  1. Create a new user to authenticate with the openlane API, this command will fail on subsequent tries because the user will already exist.
    task register
  2. Login as the user, create a new Personal Access Token that will be used to seed the data, generate a new data set, bulk load objects into the openlane API:
    task cli:seed:all

If instead, you prefer to use the CLI commands directly, keep reading.

Generate Data

Using the generate subcommand, new random data will be stored in csv files:

openlane-cloud seed generate
Generated Data
tree demodata
demodata
├── groups.csv
├── invites.csv
├── orgs.csv
└── users.csv

Init Environment

Using the init subcommand, the data in the specified directory (defaults to demodata in the current directory), the csv files will be used to generate the data.

openlane-cloud seed init

The newly created objects will be displayed when complete:

Results
> seeded environment created 100% [===============]  [3s]
Seeded Environment Created:
+--------------------------------------------------------------------------------------+
| Organization                                                                         |
+----------------------------+--------+-------------+-------------+----------+---------+
| ID                         | NAME   | DESCRIPTION | PERSONALORG | CHILDREN | MEMBERS |
+----------------------------+--------+-------------+-------------+----------+---------+
| 01J06RPZ8HQRWW4AZERHKWT2YH | Plus-U |             | false       |        0 |       1 |
+----------------------------+--------+-------------+-------------+----------+---------+
...

Contributing

See the contributing guide for more information