Skip to content

Latest commit

 

History

History
65 lines (42 loc) · 2.17 KB

002-local-dev.md

File metadata and controls

65 lines (42 loc) · 2.17 KB

Overview

This local development README guides you to install the Ziti stack built from the currently checked out source branch in this repo without any downloads, containers, scripts, or magic.

Minimum Go Version

You will need to install a version of Go that is as recent as the version used by this project. Find the current minimum version by running this command to inspect go.mod.

grep -Po '^go\s+\K\d+\.\d+(\.\d+)?$' go.mod

Build and Install All Applications

This repo contains one main Go application, i.e. ziti with many subcommands. The easiest way to build and install ziti in ${GOPATH}/bin is:

# build and install ziti CLI
go install ./ziti

If you add ${GOPATH}/bin to your executable search ${PATH} then you may immediately run the newly-built binaries. For example,

$ ziti version
v0.0.0

Run a Local Ziti Stack

Let's get a local Ziti stack up and running now that you have built and installed all the Ziti apps in this repo.

Initialize the Go Workspace

This is optional. You may skip initializing a Go workspace if you use release builds from other Go modules that this project depends upon e.g. openziti/edge, openziti/fabric.

A Go workspace is the best way to use the checked out copy of other modules' source instead of downloading releases from GitHub.

For each Ziti module you wish to develop (modify) you will need to add it to your workspace.

For this example, we'll only add the edge module.

go work init
go work use .
go work use ../edge  # assumes openziti/edge is checked out in sibling dir "edge"

This produces a go.work file.

$ cat go.work
go 1.19

use (
    .
    ../edge
)

You will need to be aware of the checked out revision in each module because it is used to satisfy imports at a higher precedence than pinned versions in go.mod. That is, you may change the version of edge that is imported by this module at build time by checking out a different version in the adjacent edge repo.

Further Exploration

Continue your OpenZiti exploration in the next article about running an OpenZiti stack locally for development.