All checks were successful
continuous-integration/drone/push Build is passing
39 lines
1.2 KiB
Bash
Executable file
39 lines
1.2 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# shellcheck shell=bash
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
# Copyright © 2022 Thorsten Schubert <tschubert@bafh.org>
|
|
|
|
set -eo pipefail
|
|
|
|
shopt -s nullglob
|
|
|
|
has() {
|
|
hash "$1" &>/dev/null
|
|
}
|
|
|
|
if has podman; then
|
|
RUNTIME=podman
|
|
else
|
|
RUNTIME=docker
|
|
fi
|
|
|
|
BRANCH=$(git branch --show-current)
|
|
IMAGE=betaco.de/strom/rust-tcpaste-http
|
|
|
|
$RUNTIME build \
|
|
--file=Containerfile.http \
|
|
--label=org.opencontainers.image.title="tcp-pasted-http" \
|
|
--label=org.opencontainers.image.authors="Thorsten Schubert <tschubert@bafh.org>" \
|
|
--label=org.opencontainers.image.licenses="AGPL-3.0" \
|
|
--label=org.opencontainers.image.url="https://betaco.de/strom/rust-tcpaste.git" \
|
|
--label=org.opencontainers.image.source="https://betaco.de/strom/rust-tcpaste/raw/branch/staging/oci/Containerfile.http" \
|
|
--label=org.opencontainers.image.created="$(date --rfc-3339=seconds)" \
|
|
--label=org.opencontainers.image.revision="$(git rev-parse HEAD)" \
|
|
--label=org.opencontainers.image.version="$(git describe --tags "$(git rev-list --tags --max-count=1)")-$(git rev-parse --short HEAD)" \
|
|
--build-arg="${PUID:-1000}" \
|
|
--build-arg="${PGID:-1000}" \
|
|
--tag="${IMAGE}:${BRANCH}" \
|
|
"$(git rev-parse --show-toplevel)"
|
|
|
|
$RUNTIME tag "${IMAGE}:${BRANCH}" "${IMAGE}:latest"
|