3 export BASE_DIR=$( cd "$(dirname "$0")" ; pwd )
5 BINARY_FILE="edge-orchestration"
6 SERVICE_DIR="/etc/systemd/system"
7 SERVICE_FILE="edge-orchestration.service"
11 echo "*****************************"
12 echo " Target Binary arch is amd64 "
13 echo "*****************************"
15 export GOPATH=$GOPATH:$BASE_DIR:$BASE_DIR/vendor
17 if [ "$1" = "all" ]; then
22 function install_prerequisite() {
23 go get github.com/axw/gocov/gocov
24 go get github.com/matm/gocov-html
25 go get github.com/Songmu/make2help/cmd/make2help
28 function build_clean() {
32 function build_binary() {
36 function build_object() {
40 function build_test() {
44 function lint_src_code() {
48 function register_service() {
50 echo "-----------------------------------"
51 echo " Create Service File [SuperUser]"
52 echo "-----------------------------------"
54 sudo systemctl stop $SERVICE_FILE
55 sudo cp $BASE_DIR/bin/$BINARY_FILE /usr/bin
56 sudo cp $BASE_DIR/packaging/$SERVICE_FILE $SERVICE_DIR
57 ls -al $SERVICE_DIR | grep $SERVICE_FILE
60 echo "----------------------------------------"
61 echo " Register Edge-Orchestration Service"
62 echo "----------------------------------------"
64 sudo systemctl daemon-reload
65 sudo systemctl restart $SERVICE_FILE
66 sudo systemctl status $SERVICE_FILE
70 if [ "$BUILD_ALL" = true ]