Fixing release pipeline
This commit is contained in:
22
scripts/build-containers.sh
Executable file
22
scripts/build-containers.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# Get current git tag, fall back to "latest" if no tags exist
|
||||
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "latest")
|
||||
|
||||
echo "Building container images with tag: $TAG"
|
||||
|
||||
# Build all services using docker compose
|
||||
docker compose build --no-cache
|
||||
|
||||
echo "Tagging images for Gitea registry..."
|
||||
|
||||
# Tag all images with the current git tag
|
||||
# Format: git.sschuhmann.de/owner/rehearsalhub/service:tag
|
||||
docker tag rehearsalhub/api:latest git.sschuhmann.de/sschuhmann/rehearshalhub/api:$TAG
|
||||
docker tag rehearsalhub/web:latest git.sschuhmann.de/sschuhmann/rehearshalhub/web:$TAG
|
||||
docker tag rehearsalhub/audio-worker:latest git.sschuhmann.de/sschuhmann/rehearshalhub/worker:$TAG
|
||||
docker tag rehearsalhub/nc-watcher:latest git.sschuhmann.de/sschuhmann/rehearshalhub/watcher:$TAG
|
||||
|
||||
echo "Build complete! Images tagged as: $TAG"
|
||||
echo "Ready for upload to git.sschuhmann.de/sschuhmann/rehearsalhub"
|
||||
29
scripts/release.sh
Executable file
29
scripts/release.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
echo "=== RehearsalHub Container Release ==="
|
||||
echo
|
||||
|
||||
# Get current git tag
|
||||
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "latest")
|
||||
echo "Releasing version: $TAG"
|
||||
echo
|
||||
|
||||
# Build containers
|
||||
echo "Step 1/2: Building containers..."
|
||||
bash scripts/build-containers.sh
|
||||
echo
|
||||
|
||||
# Upload containers
|
||||
echo "Step 2/2: Uploading containers to Gitea..."
|
||||
bash scripts/upload-containers-simple.sh
|
||||
echo
|
||||
|
||||
echo "✅ Release complete!"
|
||||
echo "All containers available at: git.sschuhmann.de/sschuhmann/rehearsalhub:$TAG"
|
||||
echo
|
||||
echo "Services:"
|
||||
echo " - api: git.sschuhmann.de/sschuhmann/rehearsalhub/api:$TAG"
|
||||
echo " - web: git.sschuhmann.de/sschuhmann/rehearsalhub/web:$TAG"
|
||||
echo " - worker: git.sschuhmann.de/sschuhmann/rehearsalhub/worker:$TAG"
|
||||
echo " - watcher: git.sschuhmann.de/sschuhmann/rehearsalhub/watcher:$TAG"
|
||||
47
scripts/test-auth.sh
Executable file
47
scripts/test-auth.sh
Executable file
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
echo "Testing Docker authentication with git.sschuhmann.de..."
|
||||
|
||||
# Test 1: Check if Docker is running
|
||||
echo "1. Checking Docker daemon..."
|
||||
if docker info >/dev/null 2>&1; then
|
||||
echo " ✅ Docker daemon is running"
|
||||
else
|
||||
echo " ❌ Docker daemon is not running"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test 2: Check if we're logged in to any registry
|
||||
echo "2. Checking Docker login status..."
|
||||
if docker system df >/dev/null 2>&1; then
|
||||
echo " ✅ Docker commands work"
|
||||
else
|
||||
echo " ❌ Docker commands failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test 3: Try to access the Gitea registry
|
||||
echo "3. Testing Gitea registry access..."
|
||||
echo " Trying to pull a test image (this may fail if image doesn't exist)..."
|
||||
|
||||
# Use a simple curl test instead of docker manifest
|
||||
echo "4. Testing registry with curl..."
|
||||
REGISTRY_URL="https://git.sschuhmann.de"
|
||||
|
||||
if command -v curl >/dev/null 2>&1; then
|
||||
if curl -s -o /dev/null -w "%{http_code}" "$REGISTRY_URL" | grep -q "^[23]"; then
|
||||
echo " ✅ Registry is accessible"
|
||||
else
|
||||
echo " ⚠️ Registry accessible but may require authentication"
|
||||
fi
|
||||
else
|
||||
echo " ⚠️ curl not available, skipping HTTP test"
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Authentication test complete!"
|
||||
echo "If you're still having issues, try:"
|
||||
echo " 1. docker logout git.sschuhmann.de"
|
||||
echo " 2. docker login git.sschuhmann.de"
|
||||
echo " 3. cat ~/.docker/config.json (check credentials)"
|
||||
39
scripts/upload-containers-simple.sh
Executable file
39
scripts/upload-containers-simple.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# Get current git tag, fall back to "latest" if no tags exist
|
||||
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "latest")
|
||||
|
||||
echo "Uploading container images to Gitea registry with tag: $TAG"
|
||||
|
||||
# Simple check - just try to push and let Docker handle authentication
|
||||
echo "Attempting to push images to git.sschuhmann.de..."
|
||||
|
||||
# Push all images to Gitea registry
|
||||
echo "Pushing api image..."
|
||||
docker push git.sschuhmann.de/sschuhmann/rehearsalhub/api:$TAG || {
|
||||
echo "Failed to push api image. Check your authentication:"
|
||||
echo " 1. Run: docker login git.sschuhmann.de"
|
||||
echo " 2. Check: cat ~/.docker/config.json"
|
||||
exit 1
|
||||
}
|
||||
|
||||
echo "Pushing web image..."
|
||||
docker push git.sschuhmann.de/sschuhmann/rehearsalhub/web:$TAG || {
|
||||
echo "Failed to push web image"
|
||||
exit 1
|
||||
}
|
||||
|
||||
echo "Pushing worker image..."
|
||||
docker push git.sschuhmann.de/sschuhmann/rehearsalhub/worker:$TAG || {
|
||||
echo "Failed to push worker image"
|
||||
exit 1
|
||||
}
|
||||
|
||||
echo "Pushing watcher image..."
|
||||
docker push git.sschuhmann.de/sschuhmann/rehearsalhub/watcher:$TAG || {
|
||||
echo "Failed to push watcher image"
|
||||
exit 1
|
||||
}
|
||||
|
||||
echo "✅ Upload complete! All images pushed to git.sschuhmann.de/sschuhmann/rehearsalhub:$TAG"
|
||||
42
scripts/upload-containers.sh
Executable file
42
scripts/upload-containers.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# Get current git tag, fall back to "latest" if no tags exist
|
||||
TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "latest")
|
||||
|
||||
echo "Uploading container images to Gitea registry with tag: $TAG"
|
||||
|
||||
# Simple authentication test - try to get registry info
|
||||
if ! docker info >/dev/null 2>&1; then
|
||||
echo "Error: Docker daemon is not running"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test authentication by trying to list repositories (this will fail if not authenticated)
|
||||
echo "Testing Gitea registry authentication..."
|
||||
if ! timeout 10s docker manifest inspect git.sschuhmann.de/sschuhmann/rehearsalhub/api:$TAG >/dev/null 2>&1; then
|
||||
# Check if the error is specifically authentication related
|
||||
TEST_OUTPUT=$(docker manifest inspect git.sschuhmann.de/sschuhmann/rehearsalhub/api:$TAG 2>&1 || true)
|
||||
if echo "$TEST_OUTPUT" | grep -qi "401\|unauthorized\|authentication required"; then
|
||||
echo "Error: Not authenticated with git.sschuhmann.de registry"
|
||||
echo "Please run: docker login git.sschuhmann.de"
|
||||
exit 1
|
||||
fi
|
||||
# If it's not an auth error, it's probably just that the image doesn't exist yet
|
||||
echo "Registry accessible (image doesn't exist yet, will be created)"
|
||||
fi
|
||||
|
||||
# Push all images to Gitea registry
|
||||
echo "Pushing api image..."
|
||||
docker push git.sschuhmann.de/sschuhmann/rehearsalhub/api:$TAG
|
||||
|
||||
echo "Pushing web image..."
|
||||
docker push git.sschuhmann.de/sschuhmann/rehearsalhub/web:$TAG
|
||||
|
||||
echo "Pushing worker image..."
|
||||
docker push git.sschuhmann.de/sschuhmann/rehearsalhub/worker:$TAG
|
||||
|
||||
echo "Pushing watcher image..."
|
||||
docker push git.sschuhmann.de/sschuhmann/rehearsalhub/watcher:$TAG
|
||||
|
||||
echo "Upload complete! All images pushed to git.sschuhmann.de/sschuhmann/rehearsalhub:$TAG"
|
||||
Reference in New Issue
Block a user