Skip to content

Commit

Permalink
Merge branch 'dev' into channel-identify
Browse files Browse the repository at this point in the history
  • Loading branch information
zxln007 committed Apr 3, 2024
2 parents 04a26da + 1bbac73 commit 9ec1e18
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ RUN set -eux; \
apt remove docker.io -y ; \
rm -rf /var/lib/apt/lists/*

COPY --from=builder /work/build/system-agent /usr/local/bin/system-agent
COPY --from=builder /work/build/aospace /usr/local/bin/aospace
COPY --from=builder /work/supervisord.conf /etc/supervisor/supervisord.conf

EXPOSE 5678
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,25 @@
# See the License for the specific language governing permissions and
# limitations under the License.

NAME=system-agent
NAME=aospace
EXE=$(NAME)$(shell go env GOEXE)
DATE=$(shell date '+%F-%T')
VERSION=$(NAME)-AO.space-$(DATE)
VERSIONNUMBER=1.0.0
BRANCH=$(shell git symbolic-ref HEAD | cut -d"/" -f 3)
COMMIT=$(shell git rev-parse HEAD | cut -c1-7)
VERSIONNUMBER="1.0.1"
VERSION=$(NAME)--"Agent-"$(VERSIONNUMBER)--$(DATE)-$(BRANCH)-$(COMMIT)
LDFLAGS=-ldflags "-s -w -X 'main.Version=${VERSION}' -X 'main.VersionNumber=${VERSIONNUMBER}'"
SOURCES=$(shell ls **/*.go)


.PHONY: all
all: exe

.PHONY: exe
exe: $(SOURCES) Makefile
echo "building..."
go env -w GO111MODULE=on
go env -w GOPROXY="https://goproxy.io,direct"
go build $(OPTIONS) $(LDFLAGS) -o build/$(NAME)

.PHONY: clean
Expand Down
9 changes: 3 additions & 6 deletions Makefile.amd64
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,23 @@
# See the License for the specific language governing permissions and
# limitations under the License.

NAME=system-agent
NAME=aospace
EXE=$(NAME)$(shell go env GOEXE)
DATE=$(shell date '+%F-%T')
BRANCH=$(shell git symbolic-ref HEAD | cut -d"/" -f 3)
COMMIT=$(shell git rev-parse HEAD | cut -c1-7)
ARCH ?= amd64
#OPTIONS=-trimpath -mod=vendor
VERSIONNUMBER="VERSIONNUMBER_PLACEHOLDER"
VERSION=$(NAME)--"EulixSpace-RaspberryPi-"$(VERSIONNUMBER)--$(DATE)-$(BRANCH)-$(COMMIT)
VERSIONNUMBER="1.0.1"
VERSION=$(NAME)--"Agent-"$(VERSIONNUMBER)--$(DATE)-$(BRANCH)-$(COMMIT)
LDFLAGS=-ldflags "-s -w -X 'main.Version=${VERSION}' -X 'main.VersionNumber=${VERSIONNUMBER}'"
SOURCES=$(shell ls **/*.go)
# CHECKS:=check

.PHONY: all
all: exe

.PHONY: exe
exe: $(SOURCES) Makefile
echo "building..."
#swag init -g biz/web/http_server.go
go env -w GO111MODULE=on
go env -w GOPROXY="https://goproxy.io,direct"
GOOS=linux GOARCH=${ARCH} go build $(OPTIONS) $(LDFLAGS) -o build/$(NAME)
Expand Down
42 changes: 42 additions & 0 deletions Makefile.riscv64
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright (c) 2022 Institute of Software, Chinese Academy of Sciences (ISCAS)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

NAME=aospace
EXE=$(NAME)$(shell go env GOEXE)
DATE=$(shell date '+%F-%T')
BRANCH=$(shell git symbolic-ref HEAD | cut -d"/" -f 3)
COMMIT=$(shell git rev-parse HEAD | cut -c1-7)
ARCH ?= riscv64
VERSIONNUMBER="1.0.1"
VERSION=$(NAME)--"Agent-"$(VERSIONNUMBER)--$(DATE)-$(BRANCH)-$(COMMIT)
LDFLAGS=-ldflags "-s -w -X 'main.Version=${VERSION}' -X 'main.VersionNumber=${VERSIONNUMBER}'"
SOURCES=$(shell ls **/*.go)

.PHONY: all
all: exe

.PHONY: exe
exe: $(SOURCES) Makefile
echo "building..."
#swag init -g biz/web/http_server.go
go env -w GO111MODULE=on
go env -w GOPROXY="https://goproxy.io,direct"
# GOOS=linux GOARCH=${ARCH} go build $(OPTIONS) $(LDFLAGS) -o build/$(NAME)
go build $(OPTIONS) $(LDFLAGS) -o build/$(NAME)

.PHONY: clean
clean:
go clean -i
rm -rf build/*

10 changes: 10 additions & 0 deletions res/aospace.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=AO.space Agent
After=bluetooth.target network.target time-sync.target

[Service]
ExecStart=/usr/local/bin/aospace
Restart=always

[Install]
WantedBy=default.target
2 changes: 1 addition & 1 deletion supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[program:system-agent]
command=/usr/local/bin/system-agent
command=/usr/local/bin/aospace
autostart=true
autorestart=true
startretries=0
Expand Down

0 comments on commit 9ec1e18

Please sign in to comment.