fix: use GitHub API to find Roc tarball URL (inconsistent naming) and fix default version to 0.0.0-alpha1
Build and Publish OCI Images / build-and-push (push) Failing after 4s
Build and Publish OCI Images / build-and-push (push) Failing after 4s
This commit is contained in:
Executable
+53
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build Roc OCI images locally.
|
||||
#
|
||||
# Usage:
|
||||
# ./scripts/build.sh [roc-version]
|
||||
#
|
||||
# Default ROC_VERSION is "0.0.0-alpha1".
|
||||
# Valid values: 0.0.0-alpha1, 0.0.0-alpha2-rolling, alpha3-rolling, alpha4-rolling
|
||||
# Uses podman by default. Override with: BUILD_CMD=docker ./scripts/build.sh
|
||||
#
|
||||
# Builds all three targets: base, dev, ci
|
||||
# Tags each with the version and ":latest".
|
||||
#
|
||||
# Registry defaults to "git.roo.lol/jbrechtel".
|
||||
# Override with: REGISTRY=localhost:5000 ./scripts/build.sh
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
ROC_VERSION="${1:-0.0.0-alpha1}"
|
||||
REGISTRY="${REGISTRY:-git.roo.lol/jbrechtel}"
|
||||
BUILD_CMD="${BUILD_CMD:-podman}"
|
||||
BUILD_FLAGS="-f Containerfile"
|
||||
HERE="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
|
||||
cd "$HERE"
|
||||
|
||||
echo "=== Building Roc OCI images (version=${ROC_VERSION}, registry=${REGISTRY}) ==="
|
||||
echo ""
|
||||
|
||||
build_target() {
|
||||
local target="$1"
|
||||
local image_name="$2"
|
||||
|
||||
echo "--- Building ${target} (${REGISTRY}/${image_name}:${ROC_VERSION}) ---"
|
||||
$BUILD_CMD build \
|
||||
$BUILD_FLAGS \
|
||||
--target "$target" \
|
||||
--build-arg "ROC_VERSION=${ROC_VERSION}" \
|
||||
-t "${REGISTRY}/${image_name}:${ROC_VERSION}" \
|
||||
-t "${REGISTRY}/${image_name}:latest" \
|
||||
.
|
||||
echo ""
|
||||
}
|
||||
|
||||
build_target base roc-tools-base
|
||||
build_target dev roc-tools-dev
|
||||
build_target ci roc-tools-ci
|
||||
|
||||
echo "=== All images built successfully ==="
|
||||
echo ""
|
||||
echo "Images:"
|
||||
$BUILD_CMD images --format "table {{.Repository}}:{{.Tag}}\t{{.Size}}" \
|
||||
| grep "${REGISTRY}/roc-tools"
|
||||
Reference in New Issue
Block a user