cloudron-drone-app/helpers/surfer/build.sh
Felix Bartels 0ac667af18 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>
2023-08-06 14:34:08 +02:00

25 lines
600 B
Bash
Executable file

#!/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"