Skip to content

Commit

Permalink
Merge pull request #292 from cloud-barista/release-v0.0.12
Browse files Browse the repository at this point in the history
Release v0.0.12
  • Loading branch information
yunkon-kim authored Apr 14, 2022
2 parents 254ff6e + 075df69 commit d201e28
Show file tree
Hide file tree
Showing 16 changed files with 153 additions and 874 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ poc-cb-net/cmd/test-client/check-response-time-of-cb-tumblebug-api/check-respons
poc-cb-net/cmd/agent/secret/
*.pem
*.pub
bin/
3 changes: 3 additions & 0 deletions Dockerfile-service
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,12 @@ FROM alpine:latest
WORKDIR /app

RUN mkdir -p config
RUN mkdir -p docs

# Copy the execution file
COPY --from=builder /cb-larva/poc-cb-net/cmd/service/service .
# Copy the swagger.json for Swagger dashboard
COPY --from=builder /cb-larva/poc-cb-net/docs/cloud_barista_network.swagger.json ./docs/

# Ports for the cb-network service
EXPOSE 8053
Expand Down
61 changes: 61 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash

# root path of cb-larva
echo "1. Set CBLARVA_ROOT path"
sleep 2
SCRIPT_DIR=`dirname ${BASH_SOURCE[0]-$0}`
export CBLARVA_ROOT=`cd $SCRIPT_DIR && pwd`
echo ${CBLARVA_ROOT}
echo ""

# create directory
echo "2. Create directories for binaries and assets"
sleep 2
mkdir ${CBLARVA_ROOT}/bin
mkdir ${CBLARVA_ROOT}/bin/config
mkdir ${CBLARVA_ROOT}/bin/web
mkdir ${CBLARVA_ROOT}/bin/docs

echo "tree -L 2 -N ${CBLARVA_ROOT}/bin"
sleep 2
tree -L 2 -N ${CBLARVA_ROOT}/bin
echo ""

# build all cb-network system components
echo "3. Build binaries"
sleep 2
cd ${CBLARVA_ROOT}/poc-cb-net
make
echo ""

# copy binaries and assets to 'bin'
echo "4. Copy binaries and assets to 'bin'"
sleep 2
cd ${CBLARVA_ROOT}/bin

# copy cb-network controller binary
cp ${CBLARVA_ROOT}/poc-cb-net/cmd/controller/controller ./

# copy service binary and asset
cp ${CBLARVA_ROOT}/poc-cb-net/cmd/service/service ./
cp ${CBLARVA_ROOT}/poc-cb-net/docs/cloud_barista_network.swagger.json ./docs/

# copy cb-network admin-web binary and assets
cp ${CBLARVA_ROOT}/poc-cb-net/cmd/admin-web/admin-web ./
cp -r ${CBLARVA_ROOT}/poc-cb-net/web/* ./web/

# copy config files
cp ${CBLARVA_ROOT}/poc-cb-net/config/template-config.yaml ./config/config.yaml
cp ${CBLARVA_ROOT}/poc-cb-net/config/template-log_conf.yaml ./config/log_conf.yaml

echo "tree -L 2 -N ${CBLARVA_ROOT}/bin"
sleep 2
tree -L 2
echo ""

echo "Done to build"
sleep 2
echo ""
echo "[Note] Please, edit 'config.yaml' and 'log_conf.yaml' before running binaries"
echo "[Note] Please, edit 'config.yaml' and 'log_conf.yaml' before running binaries"
echo "[Note] Please, edit 'config.yaml' and 'log_conf.yaml' before running binaries"
14 changes: 11 additions & 3 deletions poc-cb-net/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,20 @@
default: controller service admin_web agent demo_client

default:
@echo "Build"
controller:
go build -mod=mod -o ./cmd/controller/controller ./cmd/controller/controller.go

service:
go build -mod=mod -o ./cmd/service/service ./cmd/service/service.go

admin_web:
go build -mod=mod -o ./cmd/admin-web/admin-web ./cmd/admin-web/admin-web.go

agent:
go build -mod=mod -o ./cmd/agent/agent ./cmd/agent/agent.go

demo_client:
go build -mod=mod -o ./cmd/test-client/demo-client ./cmd/test-client/demo-client.go

production:
@echo "Build for production"
# Note - Using cgo write normal Go code that imports a pseudo-package "C". I may not need on cross-compiling.
Expand Down
Loading

0 comments on commit d201e28

Please sign in to comment.