Update surfer to 6.0

This also updates the gear and adds an optional bash script instead of
the Makefile

Signed-off-by: Felix Bartels <felix@9wd.eu>
This commit is contained in:
Felix Bartels 2023-08-06 14:34:08 +02:00
parent 32c4e2e929
commit 0ac667af18
3 changed files with 37 additions and 7 deletions

View file

@ -1,4 +1,4 @@
FROM node:lts-alpine3.12
FROM node:lts-alpine
RUN apk add --no-cache make python3 zip
# use --unsafe to not execute post actions as user nobody
RUN npm -g install cloudron-surfer@5.17.5 --unsafe && npm cache clean --force && surfer --version
RUN npm -g install cloudron-surfer@6.0.0 --unsafe && npm cache clean --force && surfer --version

View file

@ -2,20 +2,26 @@ DOCKER_REPO ?= fbartels
DOCKER_IMAGE := cloudron-surfer
VERSION := $(shell grep cloudron-surfer Dockerfile | cut -d' ' -f 5 | cut -d@ -f 2)
ifeq ($(shell command -v podman 2> /dev/null),)
CMD=docker
else
CMD=podman
endif
.PHONY: default
default: build
.PHONY: build
build:
docker build . -t $(DOCKER_IMAGE)
$(CMD) build . -t $(DOCKER_IMAGE)
.PHONY: tag
tag: build
docker tag $(DOCKER_IMAGE) $(DOCKER_REPO)/$(DOCKER_IMAGE):latest
docker tag $(DOCKER_IMAGE) $(DOCKER_REPO)/$(DOCKER_IMAGE):$(VERSION)
$(CMD) tag $(DOCKER_IMAGE) $(DOCKER_REPO)/$(DOCKER_IMAGE):latest
$(CMD) tag $(DOCKER_IMAGE) $(DOCKER_REPO)/$(DOCKER_IMAGE):$(VERSION)
.PHONY: push
push: tag
docker push $(DOCKER_REPO)/$(DOCKER_IMAGE):latest
docker push $(DOCKER_REPO)/$(DOCKER_IMAGE):$(VERSION)
$(CMD) push $(DOCKER_REPO)/$(DOCKER_IMAGE):latest
$(CMD) push $(DOCKER_REPO)/$(DOCKER_IMAGE):$(VERSION)

24
helpers/surfer/build.sh Executable file
View file

@ -0,0 +1,24 @@
#!/bin/bash
set -Eeuo pipefail
DOCKER_IMAGE=${DOCKER_IMAGE:-git.9wd.eu/felix/cloudron-surfer}
VERSION=$(grep cloudron-surfer Dockerfile | cut -d' ' -f 5 | cut -d@ -f 2)
# Function to check if a command is available
command_exists() {
command -v "$1" >/dev/null 2>&1
}
if command_exists podman; then
CMD="podman"
elif command_exists docker; then
CMD="docker"
else
echo "Error: Neither podman nor docker is installed."
exit 1
fi
$CMD build . -t "$DOCKER_IMAGE:latest"
$CMD tag "$DOCKER_IMAGE:latest" "$DOCKER_IMAGE:$VERSION"
$CMD push "$DOCKER_IMAGE:latest"
$CMD push "$DOCKER_IMAGE:$VERSION"