Compare commits

..

1 Commits

Author SHA1 Message Date
Malachi Soord 0ac5d9a677
Merge f0bfc92295 into 4e399f63ea 2023-11-19 21:20:23 +01:00
4 changed files with 24 additions and 19 deletions

View File

@ -15,9 +15,9 @@ jobs:
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v4 uses: actions/setup-go@v4
with: with:
go-version: '1.20.2' go-version: ^1.15
- name: Check out code - name: Check out code
uses: actions/checkout@v4 uses: actions/checkout@v3
- name: Build - name: Build
run: make build run: make build
- name: Test - name: Test

View File

@ -1,9 +1,11 @@
FROM golang:1.20.2 FROM golang:latest
WORKDIR /app WORKDIR /app
COPY ./ /app COPY ./ /app
RUN go install github.com/githubnemo/CompileDaemon@latest RUN go mod download
ENTRYPOINT CompileDaemon --build="make build" --command=./bin/edgeboxctl-$(go env GOOS)-$(go env GOARCH) RUN go get github.com/githubnemo/CompileDaemon
ENTRYPOINT CompileDaemon --build="make build" --command=./bin/edgeboxctl

View File

@ -1,13 +1,9 @@
.DEFAULT_GOAL := build
PROJECT?=github.com/edgebox-iot/edgeboxctl PROJECT?=github.com/edgebox-iot/edgeboxctl
RELEASE ?= dev RELEASE ?= dev
COMMIT := $(shell git rev-parse --short HEAD) COMMIT := $(shell git rev-parse --short HEAD)
BUILD_DATE := $(shell date -u '+%Y-%m-%d_%H:%M:%S') BUILD_DATE := $(shell date -u '+%Y-%m-%d_%H:%M:%S')
BUILD_DIR = bin BUILD_DIR = bin
GOOS := $(shell go env GOOS)
GOARCH := $(shell go env GOARCH)
build-all: build-all:
GOOS=linux GOARCH=amd64 make build GOOS=linux GOARCH=amd64 make build
@ -36,6 +32,7 @@ build:
-X ${PROJECT}/internal/diagnostics.Commit=${COMMIT} \ -X ${PROJECT}/internal/diagnostics.Commit=${COMMIT} \
-X ${PROJECT}/internal/diagnostics.BuildDate=${BUILD_DATE}" \ -X ${PROJECT}/internal/diagnostics.BuildDate=${BUILD_DATE}" \
-o bin/edgeboxctl-${GOOS}-${GOARCH} ${PROJECT}/cmd/edgeboxctl -o bin/edgeboxctl-${GOOS}-${GOARCH} ${PROJECT}/cmd/edgeboxctl
cp ./bin/edgeboxctl-${GOOS}-${GOARCH} ./bin/edgeboxctl
clean: clean:
rm -rf ${BUILD_DIR} rm -rf ${BUILD_DIR}
@ -50,8 +47,8 @@ test-with-coverage:
install: install:
sudo systemctl stop edgeboxctl || true sudo systemctl stop edgeboxctl || true
sudo rm -rf /usr/local/bin/edgeboxctl /usr/local/sbin/edgeboctl /lib/systemd/system/edgeboxctl.service sudo rm -rf /usr/local/bin/edgeboxctl /usr/local/sbin/edgeboctl /lib/systemd/system/edgeboxctl.service
sudo cp ./bin/edgeboxctl-${GOOS}-${GOARCH} /usr/local/bin/edgeboxctl sudo cp ./bin/edgeboxctl /usr/local/bin/edgeboxctl
sudo cp ./bin/edgeboxctl-${GOOS}-${GOARCH} /usr/local/sbin/edgeboxctl sudo cp ./bin/edgeboxctl /usr/local/sbin/edgeboxctl
sudo cp ./edgeboxctl.service /lib/systemd/system/edgeboxctl.service sudo cp ./edgeboxctl.service /lib/systemd/system/edgeboxctl.service
sudo systemctl daemon-reload sudo systemctl daemon-reload
@echo "Edgeboxctl installed successfully" @echo "Edgeboxctl installed successfully"
@ -71,3 +68,4 @@ stop:
log: start log: start
journalctl -fu edgeboxctl journalctl -fu edgeboxctl

View File

@ -8,7 +8,7 @@
<h3 align="center">Edgebox Control Module</h3> <h3 align="center">Edgebox Control Module</h3>
<p align="center"> <p align="center">
A System Control module written in Go. Its responsibility is to configure dependencies and perform system tasks, automatically on a schedule, or on demand. A System Control module written in Go. Its resonsability is to configure dependencies and perform system tasks, automatically in a schedule, or by command.
<br /> <br />
<br /> <br />
<a href="https://github.com/github_username/edgeboxctl/issues">Report Bug</a> <a href="https://github.com/github_username/edgeboxctl/issues">Report Bug</a>
@ -38,6 +38,8 @@
<!-- ABOUT THE PROJECT --> <!-- ABOUT THE PROJECT -->
## About The Project ## About The Project
[![Edgebox Screen Shot][product-screenshot]](https://edgebox.co)
Edgebox is an easy to configure and use system. It brings powerful features that go alongside or can even completely replace various services that you already use in the day-to-day. Edgebox is an easy to configure and use system. It brings powerful features that go alongside or can even completely replace various services that you already use in the day-to-day.
@ -56,15 +58,18 @@ To get a local copy up and running follow these simple steps.
### Prerequisites ### Prerequisites
If you're running for development purposes, a docker container suffices, so make sure you have: If you're installing this to run natively in the system, you better be doing it inside of the [Development Virtual Machine](https://github.com/edgebox-iot/devm). This software can do destructive action in the system is is running. You've been warned.
* docker If you're running for development purposes, a Docker container suffices, so make sure you have:
* docker compose * Docker
* Docker Compose
```sh
sudo apt-get install docker docker-compose
```
Check the following links for more info on [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/). Check the following links for more info on [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/).
Aditionally, `edgeboxctl` needs the following bash commands available wherever it runs: Aditionally, edgeboxctl needs the following bash commands available wherever it runs:
* `arm-linux-gnueabi-gcc` (`sudo apt-get install gcc-arm*`) * `arm-linux-gnueabi-gcc` (`sudo apt-get install gcc-arm*`)
* `sh` * `sh`
* `rm` * `rm`
@ -116,4 +121,4 @@ Contributions are what make the open source community such an amazing place to b
<!-- LICENSE --> <!-- LICENSE -->
## License ## License
Distributed under the Elastic License 2.0. See `LICENSE` for more information. Distributed under the MIT License. See `LICENSE` for more information.