mirror of
https://gh.wpcy.net/https://github.com/fairpm/aspirecloud.git
synced 2026-06-19 02:13:44 +08:00
27 lines
724 B
Bash
Executable file
27 lines
724 B
Bash
Executable file
#!/bin/bash
|
|
here=$(dirname "$0") && source "$here"/_prelude.bash
|
|
|
|
tag=${TAG:-$(git describe --tags --abbrev=0)}
|
|
platform=${PLATFORM:-linux/amd64,linux/arm64}
|
|
|
|
if [[ -n $GHCR_TOKEN ]]; then
|
|
echo "$GHCR_TOKEN" | docker login ghcr.io -u userame-is-ignored --password-stdin
|
|
push_arg='--push'
|
|
fi
|
|
|
|
buildx() {
|
|
local file=$1
|
|
local name=$2
|
|
local tag=$3
|
|
# shellcheck disable=SC2086
|
|
docker buildx build \
|
|
--platform "$platform" \
|
|
-f "$file" \
|
|
--target prod \
|
|
-t "ghcr.io/$name:$tag" \
|
|
-t "ghcr.io/$name:latest" \
|
|
$push_arg .
|
|
}
|
|
|
|
buildx docker/webapp/Dockerfile fairpm/aspirecloud "$tag"
|
|
buildx docker/laravel-worker/Dockerfile fairpm/aspirecloud-worker "$tag"
|