mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-13 08:36:54 +00:00
feat: disable Docker builds for development versions (#239)
* feat: disable Docker builds for development versions - Remove dev-latest, main-latest, and dev-* version options from manual triggers - Skip Docker builds for development versions in workflow_run events - Only build Docker images for releases (v1.0.0) and prereleases (v1.0.0-alpha1) - Simplify tags generation logic by removing development branch handling - Update workflow documentation to reflect release-only Docker strategy BREAKING CHANGE: Development Docker images are no longer built automatically * feat: remove dev channel support from Dockerfile - Remove CHANNEL build argument (no longer needed) - Simplify download logic to only support release channel - Remove dev-specific package download paths - Update BASE_URL to point directly to release directory - Remove channel label from Docker image metadata - Streamline version handling (latest vs specific release) This aligns with the workflow changes that disabled dev Docker builds.
This commit is contained in:
@@ -24,6 +24,7 @@
|
|||||||
# - Only triggers when Linux builds (x86_64 + aarch64) are successful
|
# - Only triggers when Linux builds (x86_64 + aarch64) are successful
|
||||||
# - Independent of macOS/Windows build status
|
# - Independent of macOS/Windows build status
|
||||||
# - Uses workflow_run event for precise control
|
# - Uses workflow_run event for precise control
|
||||||
|
# - Only builds Docker images for releases and prereleases (development builds are skipped)
|
||||||
|
|
||||||
name: Docker Images
|
name: Docker Images
|
||||||
|
|
||||||
@@ -47,9 +48,9 @@ on:
|
|||||||
default: true
|
default: true
|
||||||
type: boolean
|
type: boolean
|
||||||
version:
|
version:
|
||||||
description: "Version to build (latest, main-latest, dev-latest, or specific version like v1.0.0 or dev-abc123)"
|
description: "Version to build (latest for stable release, or specific version like v1.0.0, v1.0.0-alpha1)"
|
||||||
required: false
|
required: false
|
||||||
default: "main-latest"
|
default: "latest"
|
||||||
type: string
|
type: string
|
||||||
force_rebuild:
|
force_rebuild:
|
||||||
description: "Force rebuild even if binary exists (useful for testing)"
|
description: "Force rebuild even if binary exists (useful for testing)"
|
||||||
@@ -117,20 +118,28 @@ jobs:
|
|||||||
if [[ "${{ github.event.workflow_run.head_branch }}" == "main" ]]; then
|
if [[ "${{ github.event.workflow_run.head_branch }}" == "main" ]]; then
|
||||||
build_type="development"
|
build_type="development"
|
||||||
version="dev-${short_sha}"
|
version="dev-${short_sha}"
|
||||||
|
# Skip Docker build for development builds
|
||||||
|
should_build=false
|
||||||
|
echo "⏭️ Skipping Docker build for development version (main branch)"
|
||||||
elif [[ "${{ github.event.workflow_run.event }}" == "push" ]] && [[ "${{ github.event.workflow_run.head_branch }}" =~ ^refs/tags/ ]]; then
|
elif [[ "${{ github.event.workflow_run.event }}" == "push" ]] && [[ "${{ github.event.workflow_run.head_branch }}" =~ ^refs/tags/ ]]; then
|
||||||
# Tag push
|
# Tag push - only build for releases and prereleases
|
||||||
tag_name="${{ github.event.workflow_run.head_branch }}"
|
tag_name="${{ github.event.workflow_run.head_branch }}"
|
||||||
version="${tag_name#refs/tags/}"
|
version="${tag_name#refs/tags/}"
|
||||||
if [[ "$version" == *"alpha"* ]] || [[ "$version" == *"beta"* ]] || [[ "$version" == *"rc"* ]]; then
|
if [[ "$version" == *"alpha"* ]] || [[ "$version" == *"beta"* ]] || [[ "$version" == *"rc"* ]]; then
|
||||||
build_type="prerelease"
|
build_type="prerelease"
|
||||||
is_prerelease=true
|
is_prerelease=true
|
||||||
|
echo "🧪 Building Docker image for prerelease: $version"
|
||||||
else
|
else
|
||||||
build_type="release"
|
build_type="release"
|
||||||
create_latest=true
|
create_latest=true
|
||||||
|
echo "🚀 Building Docker image for release: $version"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
build_type="development"
|
build_type="development"
|
||||||
version="dev-${short_sha}"
|
version="dev-${short_sha}"
|
||||||
|
# Skip Docker build for development builds
|
||||||
|
should_build=false
|
||||||
|
echo "⏭️ Skipping Docker build for development version"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "🔄 Build triggered by workflow_run:"
|
echo "🔄 Build triggered by workflow_run:"
|
||||||
@@ -160,16 +169,6 @@ jobs:
|
|||||||
create_latest=true
|
create_latest=true
|
||||||
echo "🚀 Building with latest stable release version"
|
echo "🚀 Building with latest stable release version"
|
||||||
;;
|
;;
|
||||||
"main-latest")
|
|
||||||
build_type="development"
|
|
||||||
version="main-latest"
|
|
||||||
echo "🛠️ Building with main branch latest development version"
|
|
||||||
;;
|
|
||||||
"dev-latest")
|
|
||||||
build_type="development"
|
|
||||||
version="dev-latest"
|
|
||||||
echo "🛠️ Building with development latest version"
|
|
||||||
;;
|
|
||||||
v[0-9]*)
|
v[0-9]*)
|
||||||
build_type="release"
|
build_type="release"
|
||||||
create_latest=true
|
create_latest=true
|
||||||
@@ -180,14 +179,11 @@ jobs:
|
|||||||
is_prerelease=true
|
is_prerelease=true
|
||||||
echo "🧪 Building with prerelease version: $input_version"
|
echo "🧪 Building with prerelease version: $input_version"
|
||||||
;;
|
;;
|
||||||
dev-[a-f0-9]*)
|
|
||||||
build_type="development"
|
|
||||||
echo "🔧 Building with specific development version: $input_version"
|
|
||||||
;;
|
|
||||||
*)
|
*)
|
||||||
build_type="development"
|
# Invalid version for Docker build
|
||||||
echo "🔧 Building with custom version: $input_version"
|
should_build=false
|
||||||
echo "⚠️ Warning: Custom version format may not follow standard patterns"
|
echo "❌ Invalid version for Docker build: $input_version"
|
||||||
|
echo "⚠️ Only release versions (latest, v1.0.0) and prereleases (v1.0.0-alpha1) are supported"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
@@ -252,28 +248,18 @@ jobs:
|
|||||||
|
|
||||||
# Convert version format for Dockerfile compatibility
|
# Convert version format for Dockerfile compatibility
|
||||||
case "$VERSION" in
|
case "$VERSION" in
|
||||||
"main-latest"|"dev-latest")
|
|
||||||
# For latest builds, use RELEASE=latest + appropriate CHANNEL
|
|
||||||
DOCKER_RELEASE="latest"
|
|
||||||
DOCKER_CHANNEL="dev"
|
|
||||||
;;
|
|
||||||
"latest")
|
"latest")
|
||||||
# For stable latest, use RELEASE=latest + release CHANNEL
|
# For stable latest, use RELEASE=latest + release CHANNEL
|
||||||
DOCKER_RELEASE="latest"
|
DOCKER_RELEASE="latest"
|
||||||
DOCKER_CHANNEL="release"
|
DOCKER_CHANNEL="release"
|
||||||
;;
|
;;
|
||||||
dev-*)
|
|
||||||
# For development builds (dev-abc123), pass as-is without 'v' prefix
|
|
||||||
DOCKER_RELEASE="${VERSION}"
|
|
||||||
DOCKER_CHANNEL="dev"
|
|
||||||
;;
|
|
||||||
v*)
|
v*)
|
||||||
# For versioned releases (v1.0.0), remove 'v' prefix for Dockerfile
|
# For versioned releases (v1.0.0), remove 'v' prefix for Dockerfile
|
||||||
DOCKER_RELEASE="${VERSION#v}"
|
DOCKER_RELEASE="${VERSION#v}"
|
||||||
DOCKER_CHANNEL="release"
|
DOCKER_CHANNEL="release"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
# For custom versions, pass as-is
|
# For other versions, pass as-is
|
||||||
DOCKER_RELEASE="${VERSION}"
|
DOCKER_RELEASE="${VERSION}"
|
||||||
DOCKER_CHANNEL="release"
|
DOCKER_CHANNEL="release"
|
||||||
;;
|
;;
|
||||||
@@ -288,33 +274,25 @@ jobs:
|
|||||||
echo " - Docker CHANNEL: $DOCKER_CHANNEL"
|
echo " - Docker CHANNEL: $DOCKER_CHANNEL"
|
||||||
|
|
||||||
# Generate tags based on build type
|
# Generate tags based on build type
|
||||||
TAGS=""
|
# Only support release and prerelease builds (no development builds)
|
||||||
|
TAGS="${{ env.REGISTRY_DOCKERHUB }}:${VERSION}"
|
||||||
|
|
||||||
if [[ "$BUILD_TYPE" == "development" ]]; then
|
# Add channel tags for prereleases and latest for stable
|
||||||
# Development build: dev-${short_sha} and dev
|
if [[ "$CREATE_LATEST" == "true" ]]; then
|
||||||
TAGS="${{ env.REGISTRY_DOCKERHUB }}:dev-${SHORT_SHA}"
|
# Stable release
|
||||||
TAGS="$TAGS,${{ env.REGISTRY_DOCKERHUB }}:dev"
|
TAGS="$TAGS,${{ env.REGISTRY_DOCKERHUB }}:latest"
|
||||||
else
|
elif [[ "$BUILD_TYPE" == "prerelease" ]]; then
|
||||||
# Release/Prerelease build: ${version}
|
# Prerelease channel tags (alpha, beta, rc)
|
||||||
TAGS="${{ env.REGISTRY_DOCKERHUB }}:${VERSION}"
|
if [[ "$VERSION" == *"alpha"* ]]; then
|
||||||
|
CHANNEL="alpha"
|
||||||
|
elif [[ "$VERSION" == *"beta"* ]]; then
|
||||||
|
CHANNEL="beta"
|
||||||
|
elif [[ "$VERSION" == *"rc"* ]]; then
|
||||||
|
CHANNEL="rc"
|
||||||
|
fi
|
||||||
|
|
||||||
# Add channel tags for prereleases and latest for stable
|
if [[ -n "$CHANNEL" ]]; then
|
||||||
if [[ "$CREATE_LATEST" == "true" ]]; then
|
TAGS="$TAGS,${{ env.REGISTRY_DOCKERHUB }}:${CHANNEL}"
|
||||||
# Stable release
|
|
||||||
TAGS="$TAGS,${{ env.REGISTRY_DOCKERHUB }}:latest"
|
|
||||||
elif [[ "$BUILD_TYPE" == "prerelease" ]]; then
|
|
||||||
# Prerelease channel tags (alpha, beta, rc)
|
|
||||||
if [[ "$VERSION" == *"alpha"* ]]; then
|
|
||||||
CHANNEL="alpha"
|
|
||||||
elif [[ "$VERSION" == *"beta"* ]]; then
|
|
||||||
CHANNEL="beta"
|
|
||||||
elif [[ "$VERSION" == *"rc"* ]]; then
|
|
||||||
CHANNEL="rc"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -n "$CHANNEL" ]]; then
|
|
||||||
TAGS="$TAGS,${{ env.REGISTRY_DOCKERHUB }}:${CHANNEL}"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -384,14 +362,10 @@ jobs:
|
|||||||
echo "🐳 Docker build completed successfully!"
|
echo "🐳 Docker build completed successfully!"
|
||||||
echo "📦 Build type: $BUILD_TYPE"
|
echo "📦 Build type: $BUILD_TYPE"
|
||||||
echo "🔢 Version: $VERSION"
|
echo "🔢 Version: $VERSION"
|
||||||
echo "🚀 Strategy: Images using pre-built binaries (supports both release and dev channels)"
|
echo "🚀 Strategy: Images using pre-built binaries (release channel only)"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
case "$BUILD_TYPE" in
|
case "$BUILD_TYPE" in
|
||||||
"development")
|
|
||||||
echo "🛠️ Development Docker image has been built with dev-${VERSION} tags"
|
|
||||||
echo "⚠️ This is a development image - not suitable for production use"
|
|
||||||
;;
|
|
||||||
"release")
|
"release")
|
||||||
echo "🚀 Release Docker image has been built with ${VERSION} tags"
|
echo "🚀 Release Docker image has been built with ${VERSION} tags"
|
||||||
echo "✅ This image is ready for production use"
|
echo "✅ This image is ready for production use"
|
||||||
@@ -404,4 +378,7 @@ jobs:
|
|||||||
echo "⚠️ This is a prerelease image - use with caution"
|
echo "⚠️ This is a prerelease image - use with caution"
|
||||||
echo "🚫 Latest tag NOT created for prerelease"
|
echo "🚫 Latest tag NOT created for prerelease"
|
||||||
;;
|
;;
|
||||||
|
*)
|
||||||
|
echo "❌ Unexpected build type: $BUILD_TYPE"
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|||||||
+7
-21
@@ -5,7 +5,6 @@ FROM alpine:latest AS build
|
|||||||
ARG TARGETPLATFORM
|
ARG TARGETPLATFORM
|
||||||
ARG BUILDPLATFORM
|
ARG BUILDPLATFORM
|
||||||
ARG RELEASE=latest
|
ARG RELEASE=latest
|
||||||
ARG CHANNEL=release
|
|
||||||
|
|
||||||
# Install dependencies for downloading and verifying binaries
|
# Install dependencies for downloading and verifying binaries
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
@@ -27,30 +26,19 @@ RUN case "${TARGETPLATFORM}" in \
|
|||||||
esac && \
|
esac && \
|
||||||
echo "ARCH=${ARCH}" > /build/arch.env
|
echo "ARCH=${ARCH}" > /build/arch.env
|
||||||
|
|
||||||
# Download rustfs binary from dl.rustfs.com
|
# Download rustfs binary from dl.rustfs.com (release channel only)
|
||||||
RUN . /build/arch.env && \
|
RUN . /build/arch.env && \
|
||||||
BASE_URL="https://dl.rustfs.com/artifacts/rustfs" && \
|
BASE_URL="https://dl.rustfs.com/artifacts/rustfs/release" && \
|
||||||
PLATFORM="linux" && \
|
PLATFORM="linux" && \
|
||||||
if [ "${RELEASE}" = "latest" ]; then \
|
if [ "${RELEASE}" = "latest" ]; then \
|
||||||
# Download latest version from specified channel \
|
# Download latest release version \
|
||||||
if [ "${CHANNEL}" = "dev" ]; then \
|
PACKAGE_NAME="rustfs-${PLATFORM}-${ARCH}-latest.zip"; \
|
||||||
PACKAGE_NAME="rustfs-${PLATFORM}-${ARCH}-dev-latest.zip"; \
|
DOWNLOAD_URL="${BASE_URL}/${PACKAGE_NAME}"; \
|
||||||
DOWNLOAD_URL="${BASE_URL}/dev/${PACKAGE_NAME}"; \
|
echo "📥 Downloading latest release build: ${PACKAGE_NAME}"; \
|
||||||
echo "📥 Downloading latest dev build: ${PACKAGE_NAME}"; \
|
|
||||||
else \
|
|
||||||
PACKAGE_NAME="rustfs-${PLATFORM}-${ARCH}-latest.zip"; \
|
|
||||||
DOWNLOAD_URL="${BASE_URL}/release/${PACKAGE_NAME}"; \
|
|
||||||
echo "📥 Downloading latest release build: ${PACKAGE_NAME}"; \
|
|
||||||
fi; \
|
|
||||||
elif [ "${CHANNEL}" = "dev" ]; then \
|
|
||||||
# Download specific dev version \
|
|
||||||
PACKAGE_NAME="rustfs-${PLATFORM}-${ARCH}-${RELEASE}.zip"; \
|
|
||||||
DOWNLOAD_URL="${BASE_URL}/dev/${PACKAGE_NAME}"; \
|
|
||||||
echo "📥 Downloading specific dev version: ${PACKAGE_NAME}"; \
|
|
||||||
else \
|
else \
|
||||||
# Download specific release version \
|
# Download specific release version \
|
||||||
PACKAGE_NAME="rustfs-${PLATFORM}-${ARCH}-v${RELEASE}.zip"; \
|
PACKAGE_NAME="rustfs-${PLATFORM}-${ARCH}-v${RELEASE}.zip"; \
|
||||||
DOWNLOAD_URL="${BASE_URL}/release/${PACKAGE_NAME}"; \
|
DOWNLOAD_URL="${BASE_URL}/${PACKAGE_NAME}"; \
|
||||||
echo "📥 Downloading specific release version: ${PACKAGE_NAME}"; \
|
echo "📥 Downloading specific release version: ${PACKAGE_NAME}"; \
|
||||||
fi && \
|
fi && \
|
||||||
echo "🔗 Download URL: ${DOWNLOAD_URL}" && \
|
echo "🔗 Download URL: ${DOWNLOAD_URL}" && \
|
||||||
@@ -71,7 +59,6 @@ FROM alpine:latest
|
|||||||
|
|
||||||
# Set build arguments and labels
|
# Set build arguments and labels
|
||||||
ARG RELEASE=latest
|
ARG RELEASE=latest
|
||||||
ARG CHANNEL=release
|
|
||||||
ARG BUILD_DATE
|
ARG BUILD_DATE
|
||||||
ARG VCS_REF
|
ARG VCS_REF
|
||||||
|
|
||||||
@@ -80,7 +67,6 @@ LABEL name="RustFS" \
|
|||||||
maintainer="RustFS Team <dev@rustfs.com>" \
|
maintainer="RustFS Team <dev@rustfs.com>" \
|
||||||
version="${RELEASE}" \
|
version="${RELEASE}" \
|
||||||
release="${RELEASE}" \
|
release="${RELEASE}" \
|
||||||
channel="${CHANNEL}" \
|
|
||||||
build-date="${BUILD_DATE}" \
|
build-date="${BUILD_DATE}" \
|
||||||
vcs-ref="${VCS_REF}" \
|
vcs-ref="${VCS_REF}" \
|
||||||
summary="RustFS is a high-performance distributed object storage system written in Rust, compatible with S3 API." \
|
summary="RustFS is a high-performance distributed object storage system written in Rust, compatible with S3 API." \
|
||||||
|
|||||||
Reference in New Issue
Block a user