There are dev method and release method to build and run Board. This guide provides instructions for developers to build and run Board by dev method.
Board is deployed as several Docker containers and most of the code is written in Go language. The build environment requires Python, Docker, Docker Compose and golang development environment. Please install the below prerequisites:
Software | Required Version |
---|---|
docker-ce | 17.03 + |
docker-compose | 1.14.0 + |
python | 2.7 + |
git | 1.8.3 + |
make | 3.81 + |
golang | 1.9.6 + |
$ git clone http://10.110.18.40:10080/inspursoft/board.git
Edit the file make/board.cfg and make necessary configuration changes such as hostname, admin password ,mysql server and so on. Refer to Installation and Configuration Guide for more info.
$ cd board
$ vi make/board.cfg
You can compile and running by the approache:
$ make prepare
$ make compile_ui
$ make -e DEVFLAG=dev start
Refer to View and test Board REST API via Swagger for testing the Board REST API.
When you want to stop Board instance, run:
$ make -e DEVFLAG=dev down
- Using the Makefile
The Makefile
contains predefined targets:
Target | Description |
---|---|
all | Check board source file by fmt vet golint and compile |
prepare | Prepare configuration and env |
compile | Check board source file by fmt vet golint and compile |
compile_ui | Building ui |
start | Building images containers and running |
test | Runs the tests |
fmt | Formats board source files |
vet | Examines board source code and reports suspicious constructs |
golint | Linter for source code |
clean | Print help infomation about clean |
cleanall | Clean binary and images |
cleanbinary | Clean binary |
cleanimage | Clean images |
down | Stop and remove board instance |
install | Compile board binary |
build | Build board images |
package | Pack offline package of board project |
packageonestep | Generate offline package of board project by one step |
prepare_swagger | Prepare swagger environment |
container/$IMG_build | Build $IMG image |
container/$IMG_rmi | Clean $IMG image |
src/$PACKAGE_clean | Clean $PACKAGE binary |
src/$PACKAGE_fmt | Formats $PACKAGE source files |
src/$PACKAGE_install | Compile $PACKAGE binary |
src/$PACKAGE_vet | Examines $PACKAGE source code and reports suspicious constructs |
src/$PACKAGE_compile | Check $PACKAGE source file by fmt vet golint and compile |
src/$PACKAGE_golint | Linter for $PACKAGE source code |
src/$PACKAGE_test | Runs $PACKAGE tests |
Note: IMG's value is one of apiserver, tokenserver, log, collector, gitserver, jenkins, mysql and nginx. PACKAGE's value is one of apiserver, tokenserver and collector/cmd.
$ make install
$ make container/apiserver_build
$ make container/apiserver_rmi
$ make src/apiserver_fmt
$ make src/apiserver_vet
$ make src/apiserver_golint
$ make src/apiserver_install
$ make src/apiserver_compile
$ make src/apiserver_clean
Note: the board file path:$GOPATH/src/git/inspursoft/