Skip to content

Latest commit

 

History

History
76 lines (56 loc) · 2.48 KB

prereqs.md

File metadata and controls

76 lines (56 loc) · 2.48 KB

Developing for OpenPitrix [deprecated]

This document is intended to be the canonical source of truth for things like supported toolchain versions for building OpenPitrix. If you find a requirement that this doc does not capture, or if you find other docs with references to requirements that are not simply links to this doc, please submit an issue.

This document is intended to be relative to the branch in which it is found. It is guaranteed that requirements will change over time for the development branch, but release branches should not change.

Prerequisites

OpenPitrix only has few external dependencies you need to setup before being able to build and run the code.

Setting up Go

OpenPitrix written in the Go programming language. To build, you'll need a Go (version 1.9+) development environment. If you haven't set up a Go development environment, please follow these instructions to install the Go tools.

Set up your GOPATH and add a path entry for Go binaries to your PATH. Typically added to your ~/.profile:

$ export GOPATH=~/go
$ export PATH=$PATH:$GOPATH/bin

Setting up Swagger

OpenPitrix is using OpenAPI/Swagger to develop API, so follow the instructions to install Swagger. If you are not familar with Swagger, please read the tutorial. If you install Swagger using docker distribution, please run

$ docker pull quay.io/goswagger/swagger
$ alias swagger="docker run --rm -it -e GOPATH=$GOPATH:/go -v $HOME:$HOME -w $(pwd) quay.io/goswagger/swagger"
$ swagger version

To start developing OpenPitrix

There are two options to get OpenPitrix source code and build the project:

You have a working Go environment.

$ go get -d openpitrix.io/openpitrix
$ cd $GOPATH/src/openpitrix.io/openpitrix
$ make all

You have a working Docker environment.

$ git clone https://github.com/openpitrix/openpitrix
$ cd openpitrix
$ make

DevOps

Please check How to set up DevOps environment