Compare commits

..

3 Commits

Author SHA1 Message Date
Henry Dollman
be4a583126 0.0.1-alpha.3 2024-07-21 20:59:43 -04:00
Henry Dollman
75f1cb619b update hub dockerfile 2024-07-21 20:30:32 -04:00
Henry Dollman
09806e8688 fix update scripts 2024-07-21 20:03:14 -04:00
6 changed files with 30 additions and 19 deletions

View File

@@ -13,9 +13,11 @@ jobs:
matrix:
include:
- image: henrygd/beszel
context: hub
context: ./hub
dockerfile: ./hub/Dockerfile
- image: henrygd/beszel-agent
context: agent
context: ./agent
dockerfile: ./agent/Dockerfile
permissions:
contents: read
packages: write
@@ -62,7 +64,7 @@ jobs:
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: '{{defaultContext}}:${{ matrix.context }}'
context: '${{ matrix.context }}'
file: ${{ matrix.dockerfile }}
platforms: linux/amd64,linux/arm64
push: ${{ github.ref_type == 'tag' }}

View File

@@ -23,7 +23,7 @@ import (
psutilNet "github.com/shirou/gopsutil/v4/net"
)
var Version = "0.0.1-alpha.2"
var Version = "0.0.1-alpha.3"
var containerCpuMap = make(map[string][2]uint64)
var containerCpuMutex = &sync.Mutex{}

View File

@@ -16,7 +16,10 @@ func updateBeszel() {
currentVersion := semver.MustParse(Version)
fmt.Println("beszel-agent", currentVersion)
fmt.Println("Checking for updates...")
latest, found, err = selfupdate.DetectLatest("henrygd/beszel")
updater, _ := selfupdate.NewUpdater(selfupdate.Config{
Filters: []string{"beszel-agent"},
})
latest, found, err = updater.DetectLatest("henrygd/beszel")
if err != nil {
fmt.Println("Error checking for updates:", err)
@@ -28,7 +31,7 @@ func updateBeszel() {
os.Exit(0)
}
fmt.Println("Latest version", "v", latest.Version)
fmt.Println("Latest version:", latest.Version)
if latest.Version.LTE(currentVersion) {
fmt.Println("You are up to date")

View File

@@ -6,26 +6,29 @@ WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
# Copy source files
COPY *.go ./
COPY migrations ./migrations
COPY site/dist ./site/dist
COPY site/*.go ./site
RUN apk add --no-cache \
unzip \
ca-certificates
RUN update-ca-certificates
# Build
ARG TARGETOS TARGETARCH
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-w -s" -o /beszel .
# ? -------------------------
FROM alpine:latest
RUN apk add --no-cache \
unzip \
ca-certificates
FROM scratch
COPY --from=builder /beszel /
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY ./site/dist /site/dist
EXPOSE 8080
EXPOSE 8090
ENTRYPOINT [ "/beszel" ]
CMD ["serve", "--http=0.0.0.0:8080"]
CMD ["serve", "--http=0.0.0.0:8090"]

View File

@@ -31,7 +31,7 @@ import (
"golang.org/x/crypto/ssh"
)
var Version = "0.0.1-alpha.2"
var Version = "0.0.1-alpha.3"
var app *pocketbase.PocketBase
var serverConnections = make(map[string]Server)

View File

@@ -17,7 +17,10 @@ func updateBeszel(cmd *cobra.Command, args []string) {
currentVersion := semver.MustParse(Version)
fmt.Println("beszel", currentVersion)
fmt.Println("Checking for updates...")
latest, found, err = selfupdate.DetectLatest("henrygd/beszel")
updater, _ := selfupdate.NewUpdater(selfupdate.Config{
Filters: []string{"beszel_"},
})
latest, found, err = updater.DetectLatest("henrygd/beszel")
if err != nil {
fmt.Println("Error checking for updates:", err)
@@ -29,7 +32,7 @@ func updateBeszel(cmd *cobra.Command, args []string) {
os.Exit(0)
}
fmt.Println("Latest version", "v", latest.Version)
fmt.Println("Latest version:", latest.Version)
if latest.Version.LTE(currentVersion) {
fmt.Println("You are up to date")