- {`sudo tee /etc/yum.repos.d/documentdb.repo <{`# Add repository configuration
+sudo tee /etc/yum.repos.d/documentdb.repo <
+# Install DocumentDB for your PostgreSQL version
+sudo yum install postgresql16-documentdb
+# Available packages: postgresql16-documentdb, postgresql17-documentdb
+
+# List all available DocumentDB packages
+yum search documentdb`}
postgresql-15-documentdb - DocumentDB extension for PostgreSQL 15
-
postgresql-16-documentdb - DocumentDB extension for PostgreSQL 16
-
postgresql-17-documentdb - DocumentDB extension for PostgreSQL 17
+
+
+ APT Packages
+
+
+ Debian 11/12, Ubuntu 22.04/24.04
+
+
+
• postgresql-15-documentdb
+
• postgresql-16-documentdb
+
• postgresql-17-documentdb
+
-
RPM Packages (RHEL/CentOS/Fedora)
-
-
postgresql16-documentdb - DocumentDB extension for PostgreSQL 16
-
postgresql17-documentdb - DocumentDB extension for PostgreSQL 17
+
+
+ RPM Packages
+
+
+ RHEL 8/9, CentOS, Fedora
+
+
+
• postgresql16-documentdb
+
• postgresql17-documentdb
-
-
- Note: These packages are currently unsigned. Use the trusted=yes flag for APT or gpgcheck=0 for YUM as shown in the examples above.
-
+
+
+
+
+
+
+
Multi-Architecture Support
+
+ All packages support both AMD64 and ARM64 architectures (including Apple Silicon, AWS Graviton, etc.)
+
+
From f6f8874079a1cc0b64422e78ab4374dc964fce86 Mon Sep 17 00:00:00 2001
From: Shuai Tian
Date: Tue, 4 Nov 2025 09:25:33 +0000
Subject: [PATCH 08/17] Clean up repository build script: remove verbose
logging and unnecessary comments
---
.github/scripts/download_packages.sh | 337 ++++++---------------------
1 file changed, 71 insertions(+), 266 deletions(-)
diff --git a/.github/scripts/download_packages.sh b/.github/scripts/download_packages.sh
index 3752f71..c7b630e 100755
--- a/.github/scripts/download_packages.sh
+++ b/.github/scripts/download_packages.sh
@@ -1,31 +1,19 @@
#!/bin/bash
set -e
-# Repository to download packages from
REPO="documentdb/documentdb"
-
-# Output directory
OUT_DIR="out"
-
-# Version Configuration
-# Set to specific version (e.g., "v0.107-0") or "latest" for most recent release
DOCUMENTDB_VERSION="${DOCUMENTDB_VERSION:-latest}"
-# Multi-version support: set to "true" to keep multiple versions in repository
MULTI_VERSION="${MULTI_VERSION:-true}"
-
-# Repository configuration
SUITE="${SUITE:-stable}"
COMPONENTS="${COMPONENTS:-main}"
ORIGIN="${ORIGIN:-DocumentDB}"
-
DESCRIPTION="${DESCRIPTION:-DocumentDB APT and YUM Repository}"
-# Function to sign DEB packages
sign_deb_package() {
local package_file="$1"
if [ -n "$GPG_FINGERPRINT" ] && [ -f "$package_file" ]; then
echo " Signing DEB package: $(basename "$package_file")"
- # DEB packages can be signed using dpkg-sig
if command -v dpkg-sig >/dev/null 2>&1; then
dpkg-sig --sign builder --gpg-options "--default-key $GPG_FINGERPRINT" "$package_file" || echo " Warning: Could not sign $(basename "$package_file")"
else
@@ -66,7 +54,6 @@ generate_hashes() {
HASH_TYPE="$1"
HASH_COMMAND="$2"
echo "${HASH_TYPE}:"
- # Find all component directories and generate hashes for all files
for component in ${COMPONENTS} deb11 deb12 ubuntu22 ubuntu24; do
if [ -d "$component" ]; then
find "$component" -type f | while read -r file
@@ -79,37 +66,26 @@ generate_hashes() {
echo "Downloading packages from $REPO releases"
-# Get release info based on DOCUMENTDB_VERSION setting
if [ "$DOCUMENTDB_VERSION" = "latest" ]; then
- echo "Fetching latest release..."
if release=$(curl -fqs "https://api.github.com/repos/${REPO}/releases" | python3 -c "import sys, json; releases = json.load(sys.stdin); print(json.dumps(releases[0])) if releases else sys.exit(1)")
then
tag="$(echo "$release" | python3 -c "import sys, json; print(json.load(sys.stdin)['tag_name'])")"
- echo "Found latest release: $tag"
+ echo "Using latest release: $tag"
else
echo "Error: Could not fetch latest release information"
exit 1
fi
else
- echo "Using specified version: $DOCUMENTDB_VERSION"
tag="$DOCUMENTDB_VERSION"
- # Verify the specified version exists
if ! release=$(curl -fqs "https://api.github.com/repos/${REPO}/releases/tags/$tag")
then
echo "Error: Version $tag not found in releases"
exit 1
fi
- echo "Found specified release: $tag"
+ echo "Using specified release: $tag"
fi
-# Show version information now that we have the tag
-
-
- # Create packages directory for direct downloads
- mkdir -p out/packages
-
- # Process each asset
- # First, create a temporary file to store asset information
+mkdir -p out/packages
ASSETS_FILE=$(mktemp)
echo "$release" | python3 -c "
import sys, json
@@ -125,121 +101,56 @@ for asset in data.get('assets', []):
continue
fi
- echo "Processing: $filename"
-
- # Determine file type and handle accordingly
if [[ "$filename" == *.deb ]]; then
- # Always download all deb packages for direct access
- mkdir -p out/packages
- echo " Downloading DEB package for direct download"
wget -q -P out/packages "$download_url"
- # For APT repository, organize packages by distribution
if [[ "$filename" =~ ^deb11-postgresql-[0-9]+-documentdb.*\.deb$ ]]; then
GOT_DEB=1
mkdir -p "$DEB_POOL_DEB11"
clean_name=$(echo "$filename" | sed 's/^deb11-//')
- echo " Adding Debian 11 package to APT repository: $filename -> $clean_name"
- if [ "$MULTI_VERSION" = "true" ]; then
- # Multi-version mode: overwrite same version, preserve different versions
- cp "out/packages/$filename" "$DEB_POOL_DEB11/$clean_name"
- sign_deb_package "$DEB_POOL_DEB11/$clean_name"
- if [ -f "$DEB_POOL_DEB11/$clean_name" ]; then
- echo " Updated existing package: $clean_name"
- else
- echo " Added new package: $clean_name"
- fi
- else
- # Single version mode: overwrite everything
- cp "out/packages/$filename" "$DEB_POOL_DEB11/$clean_name"
- sign_deb_package "$DEB_POOL_DEB11/$clean_name"
- fi
+ cp "out/packages/$filename" "$DEB_POOL_DEB11/$clean_name"
+ sign_deb_package "$DEB_POOL_DEB11/$clean_name"
elif [[ "$filename" =~ ^deb12-postgresql-[0-9]+-documentdb.*\.deb$ ]]; then
GOT_DEB=1
mkdir -p "$DEB_POOL_DEB12"
clean_name=$(echo "$filename" | sed 's/^deb12-//')
- echo " Adding Debian 12 package to APT repository: $filename -> $clean_name"
- if [ "$MULTI_VERSION" = "true" ]; then
- cp "out/packages/$filename" "$DEB_POOL_DEB12/$clean_name"
- sign_deb_package "$DEB_POOL_DEB12/$clean_name"
- echo " Updated package: $clean_name"
- else
- cp "out/packages/$filename" "$DEB_POOL_DEB12/$clean_name"
- sign_deb_package "$DEB_POOL_DEB12/$clean_name"
- fi
+ cp "out/packages/$filename" "$DEB_POOL_DEB12/$clean_name"
+ sign_deb_package "$DEB_POOL_DEB12/$clean_name"
elif [[ "$filename" =~ ^ubuntu22\.04-postgresql-[0-9]+-documentdb.*\.deb$ ]]; then
GOT_DEB=1
mkdir -p "$DEB_POOL_UBUNTU22"
clean_name=$(echo "$filename" | sed 's/^ubuntu22\.04-//')
- echo " Adding Ubuntu 22.04 package to APT repository: $filename -> $clean_name"
- if [ "$MULTI_VERSION" = "true" ]; then
- cp "out/packages/$filename" "$DEB_POOL_UBUNTU22/$clean_name"
- sign_deb_package "$DEB_POOL_UBUNTU22/$clean_name"
- echo " Updated package: $clean_name"
- else
- cp "out/packages/$filename" "$DEB_POOL_UBUNTU22/$clean_name"
- sign_deb_package "$DEB_POOL_UBUNTU22/$clean_name"
- fi
+ cp "out/packages/$filename" "$DEB_POOL_UBUNTU22/$clean_name"
+ sign_deb_package "$DEB_POOL_UBUNTU22/$clean_name"
elif [[ "$filename" =~ ^ubuntu24\.04-postgresql-[0-9]+-documentdb.*\.deb$ ]]; then
GOT_DEB=1
mkdir -p "$DEB_POOL_UBUNTU24"
clean_name=$(echo "$filename" | sed 's/^ubuntu24\.04-//')
- echo " Adding Ubuntu 24.04 package to APT repository: $filename -> $clean_name"
- if [ "$MULTI_VERSION" = "true" ]; then
- cp "out/packages/$filename" "$DEB_POOL_UBUNTU24/$clean_name"
- sign_deb_package "$DEB_POOL_UBUNTU24/$clean_name"
- echo " Updated package: $clean_name"
- else
- cp "out/packages/$filename" "$DEB_POOL_UBUNTU24/$clean_name"
- sign_deb_package "$DEB_POOL_UBUNTU24/$clean_name"
- fi
- else
- echo " Skipping $filename for APT repository (unsupported distribution or architecture)"
+ cp "out/packages/$filename" "$DEB_POOL_UBUNTU24/$clean_name"
+ sign_deb_package "$DEB_POOL_UBUNTU24/$clean_name"
fi
elif [[ "$filename" == *.rpm ]]; then
- # Always download all RPM packages for direct access
- mkdir -p out/packages
- echo " Downloading RPM package for direct download"
wget -q -P out/packages "$download_url"
- # For YUM repository, organize packages by distribution
if [[ "$filename" =~ ^rhel8-postgresql[0-9]+-documentdb.*\.rpm$ ]]; then
GOT_RPM=1
mkdir -p "$RPM_POOL_RHEL8"
clean_name=$(echo "$filename" | sed 's/^rhel8-//')
- echo " Adding RHEL 8 package to YUM repository: $filename -> $clean_name"
- if [ "$MULTI_VERSION" = "true" ]; then
- cp "out/packages/$filename" "$RPM_POOL_RHEL8/$clean_name"
- echo " Updated package: $clean_name"
- else
- cp "out/packages/$filename" "$RPM_POOL_RHEL8/$clean_name"
- fi
+ cp "out/packages/$filename" "$RPM_POOL_RHEL8/$clean_name"
elif [[ "$filename" =~ ^rhel9-postgresql[0-9]+-documentdb.*\.rpm$ ]]; then
GOT_RPM=1
mkdir -p "$RPM_POOL_RHEL9"
clean_name=$(echo "$filename" | sed 's/^rhel9-//')
- echo " Adding RHEL 9 package to YUM repository: $filename -> $clean_name"
- if [ "$MULTI_VERSION" = "true" ]; then
- cp "out/packages/$filename" "$RPM_POOL_RHEL9/$clean_name"
- echo " Updated package: $clean_name"
- else
- cp "out/packages/$filename" "$RPM_POOL_RHEL9/$clean_name"
- fi
- else
- echo " Skipping $filename for YUM repository (unsupported distribution or architecture)"
+ cp "out/packages/$filename" "$RPM_POOL_RHEL9/$clean_name"
fi
else
- # Other files go directly to packages
- echo " Downloading to packages directory"
wget -q -P out/packages "$download_url"
fi
done < "$ASSETS_FILE"
- # Clean up temporary file
- rm -f "$ASSETS_FILE"
-
- # Save release metadata
- echo "$release" | python3 -c "
+rm -f "$ASSETS_FILE"
+
+echo "$release" | python3 -c "
import sys, json
data = json.load(sys.stdin)
output = {
@@ -256,42 +167,46 @@ output = {
}
print(json.dumps(output, indent=2))
" > out/packages/release-info.json
-
- echo "Successfully processed packages from $REPO"
- echo "GOT_DEB=$GOT_DEB, GOT_RPM=$GOT_RPM"
-
-# Check distribution-specific DEB pools
-echo "Checking distribution-specific DEB pools..."
-for pool in "$DEB_POOL_DEB11" "$DEB_POOL_DEB12" "$DEB_POOL_UBUNTU22" "$DEB_POOL_UBUNTU24"; do
- if [ -d "$pool" ]; then
- echo "Found pool: $pool with $(ls -1 $pool/*.deb 2>/dev/null | wc -l) packages"
- fi
-done
-echo "Checking RPM pools..."
-for pool in "$RPM_POOL_RHEL8" "$RPM_POOL_RHEL9"; do
- if [ -d "$pool" ]; then
- echo "Found pool: $pool with $(ls -1 $pool/*.rpm 2>/dev/null | wc -l) packages"
- fi
-done
+echo "Successfully processed packages from $REPO"
if [ "$GOT_DEB" = "1" ]; then
echo "Building APT repository with multiple distribution components..."
pushd out/deb >/dev/null
- # Create main component with Ubuntu 22.04 packages (for backward compatibility)
- if [ -d "pool/ubuntu22" ] && [ "$(ls -A pool/ubuntu22/*.deb 2>/dev/null)" ]; then
- # AMD64 packages
- mkdir -p "${DEB_DISTS_COMPONENTS_AMD64}"
- echo "Scanning Ubuntu 22.04 AMD64 packages for main component"
+ if [ -d "pool/ubuntu22" ] && [ "$(ls -A pool/ubuntu22/*.deb 2>/dev/null)" ]; then
+ mkdir -p "${DEB_DISTS_COMPONENTS_AMD64}" "${DEB_DISTS_COMPONENTS_ARM64}"
dpkg-scanpackages --arch amd64 pool/ubuntu22/ > "${DEB_DISTS_COMPONENTS_AMD64}/Packages"
- gzip -k -f "${DEB_DISTS_COMPONENTS_AMD64}/Packages"
-
- # ARM64 packages
- mkdir -p "${DEB_DISTS_COMPONENTS_ARM64}"
- echo "Scanning Ubuntu 22.04 ARM64 packages for main component"
dpkg-scanpackages --arch arm64 pool/ubuntu22/ > "${DEB_DISTS_COMPONENTS_ARM64}/Packages"
- gzip -k -f "${DEB_DISTS_COMPONENTS_ARM64}/Packages"
+ gzip -k -f "${DEB_DISTS_COMPONENTS_AMD64}/Packages" "${DEB_DISTS_COMPONENTS_ARM64}/Packages"
+ fi
+
+ if [ -d "pool/deb11" ] && [ "$(ls -A pool/deb11/*.deb 2>/dev/null)" ]; then
+ mkdir -p "${DEB_DISTS_DEB11_AMD64}" "${DEB_DISTS_DEB11_ARM64}"
+ dpkg-scanpackages --arch amd64 pool/deb11/ > "${DEB_DISTS_DEB11_AMD64}/Packages"
+ dpkg-scanpackages --arch arm64 pool/deb11/ > "${DEB_DISTS_DEB11_ARM64}/Packages"
+ gzip -k -f "${DEB_DISTS_DEB11_AMD64}/Packages" "${DEB_DISTS_DEB11_ARM64}/Packages"
+ fi
+
+ if [ -d "pool/deb12" ] && [ "$(ls -A pool/deb12/*.deb 2>/dev/null)" ]; then
+ mkdir -p "${DEB_DISTS_DEB12_AMD64}" "${DEB_DISTS_DEB12_ARM64}"
+ dpkg-scanpackages --arch amd64 pool/deb12/ > "${DEB_DISTS_DEB12_AMD64}/Packages"
+ dpkg-scanpackages --arch arm64 pool/deb12/ > "${DEB_DISTS_DEB12_ARM64}/Packages"
+ gzip -k -f "${DEB_DISTS_DEB12_AMD64}/Packages" "${DEB_DISTS_DEB12_ARM64}/Packages"
+ fi
+
+ if [ -d "pool/ubuntu22" ] && [ "$(ls -A pool/ubuntu22/*.deb 2>/dev/null)" ]; then
+ mkdir -p "${DEB_DISTS_UBUNTU22_AMD64}" "${DEB_DISTS_UBUNTU22_ARM64}"
+ dpkg-scanpackages --arch amd64 pool/ubuntu22/ > "${DEB_DISTS_UBUNTU22_AMD64}/Packages"
+ dpkg-scanpackages --arch arm64 pool/ubuntu22/ > "${DEB_DISTS_UBUNTU22_ARM64}/Packages"
+ gzip -k -f "${DEB_DISTS_UBUNTU22_AMD64}/Packages" "${DEB_DISTS_UBUNTU22_ARM64}/Packages"
+ fi
+
+ if [ -d "pool/ubuntu24" ] && [ "$(ls -A pool/ubuntu24/*.deb 2>/dev/null)" ]; then
+ mkdir -p "${DEB_DISTS_UBUNTU24_AMD64}" "${DEB_DISTS_UBUNTU24_ARM64}"
+ dpkg-scanpackages --arch amd64 pool/ubuntu24/ > "${DEB_DISTS_UBUNTU24_AMD64}/Packages"
+ dpkg-scanpackages --arch arm64 pool/ubuntu24/ > "${DEB_DISTS_UBUNTU24_ARM64}/Packages"
+ gzip -k -f "${DEB_DISTS_UBUNTU24_AMD64}/Packages" "${DEB_DISTS_UBUNTU24_ARM64}/Packages"
fi
# Create deb11 component (Debian 11 Bullseye)
@@ -409,156 +324,46 @@ if [ "$GOT_DEB" = "1" ]; then
echo "APT repository built successfully with multiple distribution support"
fi
-# Build RPM repositories if we have RPM packages
if [ "$GOT_RPM" = "1" ]; then
- echo "Building YUM repositories for different RHEL versions..."
+ echo "Building YUM repositories..."
- # Build RHEL 8 repository
- if [ -d "$RPM_POOL_RHEL8" ] && [ "$(ls -A $RPM_POOL_RHEL8/*.rpm 2>/dev/null)" ]; then
- echo "Building RHEL 8 YUM repository..."
- echo "RHEL 8 packages found: $(ls -1 $RPM_POOL_RHEL8/*.rpm | wc -l)"
- pushd "$RPM_POOL_RHEL8" >/dev/null
-
- # Sign RPMs if GPG is available
- if [ -n "$GPG_FINGERPRINT" ]; then
- echo "Signing RHEL 8 RPM packages"
- for rpm_file in *.rpm; do
- echo "Signing: $rpm_file"
- rpm --define "%_signature gpg" --define "%_gpg_name ${GPG_FINGERPRINT}" --addsign "$rpm_file" || echo "Warning: Could not sign $rpm_file"
- done
- fi
-
- echo "Creating RHEL 8 YUM repository metadata"
- if command -v createrepo_c >/dev/null 2>&1; then
- echo "Running: createrepo_c ."
- createrepo_c . || echo "Error: createrepo_c failed for RHEL 8"
- echo "Repository metadata created. Contents:"
- ls -la repodata/ 2>/dev/null || echo "No repodata directory found"
- else
- echo "Error: createrepo_c not found, cannot create YUM repository metadata"
- fi
-
- # Sign repository metadata if GPG is available
- if [ -n "$GPG_FINGERPRINT" ] && [ -f repodata/repomd.xml ]; then
- echo "Signing RHEL 8 repository metadata"
- gpg --default-key "$GPG_FINGERPRINT" --detach-sign --armor repodata/repomd.xml || echo "Warning: Could not sign repodata/repomd.xml"
- fi
-
- popd >/dev/null
- else
- echo "No RHEL 8 packages found in $RPM_POOL_RHEL8"
- fi
-
- # Build RHEL 9 repository
- if [ -d "$RPM_POOL_RHEL9" ] && [ "$(ls -A $RPM_POOL_RHEL9/*.rpm 2>/dev/null)" ]; then
- echo "Building RHEL 9 YUM repository..."
- echo "RHEL 9 packages found: $(ls -1 $RPM_POOL_RHEL9/*.rpm | wc -l)"
- pushd "$RPM_POOL_RHEL9" >/dev/null
-
- # Sign RPMs if GPG is available
- if [ -n "$GPG_FINGERPRINT" ]; then
- echo "Signing RHEL 9 RPM packages"
- for rpm_file in *.rpm; do
- echo "Signing: $rpm_file"
- rpm --define "%_signature gpg" --define "%_gpg_name ${GPG_FINGERPRINT}" --addsign "$rpm_file" || echo "Warning: Could not sign $rpm_file"
- done
- fi
-
- echo "Creating RHEL 9 YUM repository metadata"
- if command -v createrepo_c >/dev/null 2>&1; then
- echo "Running: createrepo_c ."
- createrepo_c . || echo "Error: createrepo_c failed for RHEL 9"
- echo "Repository metadata created. Contents:"
- ls -la repodata/ 2>/dev/null || echo "No repodata directory found"
- else
- echo "Error: createrepo_c not found, cannot create YUM repository metadata"
- fi
-
- # Sign repository metadata if GPG is available
- if [ -n "$GPG_FINGERPRINT" ] && [ -f repodata/repomd.xml ]; then
- echo "Signing RHEL 9 repository metadata"
- gpg --default-key "$GPG_FINGERPRINT" --detach-sign --armor repodata/repomd.xml || echo "Warning: Could not sign repodata/repomd.xml"
+ for POOL in "$RPM_POOL_RHEL8" "$RPM_POOL_RHEL9"; do
+ if [ -d "$POOL" ] && [ "$(find "$POOL" -name "*.rpm" -type f | wc -l)" -gt 0 ]; then
+ pushd "$POOL" >/dev/null
+
+ if [ -n "$GPG_FINGERPRINT" ]; then
+ for rpm_file in *.rpm; do
+ rpm --define "%_signature gpg" --define "%_gpg_name ${GPG_FINGERPRINT}" --addsign "$rpm_file" 2>/dev/null || true
+ done
+ fi
+
+ createrepo_c . >/dev/null 2>&1 || echo "Warning: createrepo_c failed for $POOL"
+
+ if [ -n "$GPG_FINGERPRINT" ] && [ -f repodata/repomd.xml ]; then
+ gpg --default-key "$GPG_FINGERPRINT" --detach-sign --armor repodata/repomd.xml 2>/dev/null || true
+ fi
+
+ popd >/dev/null
fi
-
- popd >/dev/null
- else
- echo "No RHEL 9 packages found in $RPM_POOL_RHEL9"
- fi
+ done
- # Also create a main RPM repository with RHEL 8 packages for backward compatibility
- if [ -d "$RPM_POOL_RHEL8" ] && [ "$(ls -A $RPM_POOL_RHEL8/*.rpm 2>/dev/null)" ]; then
- echo "Creating main YUM repository (RHEL 8 packages for backward compatibility)"
+ # Create main repository for backward compatibility
+ if [ -d "$RPM_POOL_RHEL8" ] && [ "$(find "$RPM_POOL_RHEL8" -name "*.rpm" -type f | wc -l)" -gt 0 ]; then
mkdir -p out/rpm/main
cp "$RPM_POOL_RHEL8"/* out/rpm/main/
- echo "Copied $(ls -1 out/rpm/main/*.rpm | wc -l) packages to main repository"
pushd out/rpm/main >/dev/null
-
- if command -v createrepo_c >/dev/null 2>&1; then
- echo "Running: createrepo_c . (for main repository)"
- createrepo_c . || echo "Error: createrepo_c failed for main repository"
- echo "Main repository metadata created. Contents:"
- ls -la repodata/ 2>/dev/null || echo "No repodata directory found"
- else
- echo "Error: createrepo_c not found, cannot create main YUM repository metadata"
- fi
-
+ createrepo_c . >/dev/null 2>&1 || true
if [ -n "$GPG_FINGERPRINT" ] && [ -f repodata/repomd.xml ]; then
- echo "Signing main repository metadata"
- gpg --default-key "$GPG_FINGERPRINT" --detach-sign --armor repodata/repomd.xml || echo "Warning: Could not sign main repodata/repomd.xml"
+ gpg --default-key "$GPG_FINGERPRINT" --detach-sign --armor repodata/repomd.xml 2>/dev/null || true
fi
popd >/dev/null
- else
- echo "No RHEL 8 packages found for main repository"
fi
echo "YUM repositories built successfully"
fi
-echo ""
echo "Package repository setup complete!"
-echo ""
-echo "=== Repository Structure Summary ==="
-
-# DEB Repository Status
-if [ -d out/deb ]; then
- DEB_COUNT=$(find out/deb -name "*.deb" | wc -l)
- DEB_RELEASE_FILE=$([ -f out/deb/dists/stable/Release ] && echo "✓" || echo "✗")
- echo "DEB repository: ✓ Created with $DEB_COUNT signed packages, Release file: $DEB_RELEASE_FILE"
-else
- echo "DEB repository: ✗ Not found"
-fi
-
-# RPM Repository Status
-if [ -d out/rpm ]; then
- RPM_COUNT=$(find out/rpm -name "*.rpm" | wc -l)
- RHEL8_REPO=$([ -f out/rpm/rhel8/repodata/repomd.xml ] && echo "✓" || echo "✗")
- RHEL9_REPO=$([ -f out/rpm/rhel9/repodata/repomd.xml ] && echo "✓" || echo "✗")
- MAIN_REPO=$([ -f out/rpm/main/repodata/repomd.xml ] && echo "✓" || echo "✗")
- echo "RPM repository: ✓ Created with $RPM_COUNT packages"
- echo " - RHEL 8 metadata: $RHEL8_REPO"
- echo " - RHEL 9 metadata: $RHEL9_REPO"
- echo " - Main metadata: $MAIN_REPO"
-else
- echo "RPM repository: ✗ Not found"
-fi
-
-# Direct Downloads Status
-if [ -d out/packages ]; then
- PKG_COUNT=$(ls out/packages/*.{deb,rpm} 2>/dev/null | wc -l)
- PKG_INDEX=$([ -f out/packages/index.html ] && echo "✓" || echo "✗")
- echo "Direct downloads: ✓ Available with $PKG_COUNT packages, Index: $PKG_INDEX"
-else
- echo "Direct downloads: ✗ Not found"
-fi
-
-# GPG Key Status
-if [ -f out/documentdb-archive-keyring.gpg ]; then
- echo "GPG key: ✓ Exported"
-else
- echo "GPG key: ✗ Not found"
-fi
-
echo ""
echo "Repository URLs:"
echo " APT: https://documentdb.io/deb stable main"
From ea88251c967f3c5e5ddf6a1d1f17f96b8a83b394 Mon Sep 17 00:00:00 2001
From: Shuai Tian
Date: Tue, 4 Nov 2025 09:42:08 +0000
Subject: [PATCH 09/17] Add debugging for YUM repository creation
- Show which YUM repositories are being processed
- Display createrepo_c execution path and results
- List repodata contents to verify metadata creation
- Keep error messages visible for troubleshooting
---
.github/scripts/download_packages.sh | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/.github/scripts/download_packages.sh b/.github/scripts/download_packages.sh
index c7b630e..96d77c6 100755
--- a/.github/scripts/download_packages.sh
+++ b/.github/scripts/download_packages.sh
@@ -329,6 +329,7 @@ if [ "$GOT_RPM" = "1" ]; then
for POOL in "$RPM_POOL_RHEL8" "$RPM_POOL_RHEL9"; do
if [ -d "$POOL" ] && [ "$(find "$POOL" -name "*.rpm" -type f | wc -l)" -gt 0 ]; then
+ echo "Processing YUM repository: $POOL"
pushd "$POOL" >/dev/null
if [ -n "$GPG_FINGERPRINT" ]; then
@@ -337,22 +338,37 @@ if [ "$GOT_RPM" = "1" ]; then
done
fi
- createrepo_c . >/dev/null 2>&1 || echo "Warning: createrepo_c failed for $POOL"
+ echo "Running createrepo_c in $(pwd)"
+ if createrepo_c .; then
+ echo "Repository metadata created successfully"
+ ls -la repodata/ 2>/dev/null || echo "No repodata directory found"
+ else
+ echo "ERROR: createrepo_c failed for $POOL"
+ fi
if [ -n "$GPG_FINGERPRINT" ] && [ -f repodata/repomd.xml ]; then
gpg --default-key "$GPG_FINGERPRINT" --detach-sign --armor repodata/repomd.xml 2>/dev/null || true
fi
popd >/dev/null
+ else
+ echo "Skipping $POOL: directory not found or no RPM files"
fi
done
# Create main repository for backward compatibility
if [ -d "$RPM_POOL_RHEL8" ] && [ "$(find "$RPM_POOL_RHEL8" -name "*.rpm" -type f | wc -l)" -gt 0 ]; then
+ echo "Creating main YUM repository"
mkdir -p out/rpm/main
cp "$RPM_POOL_RHEL8"/* out/rpm/main/
pushd out/rpm/main >/dev/null
- createrepo_c . >/dev/null 2>&1 || true
+ echo "Running createrepo_c for main repository in $(pwd)"
+ if createrepo_c .; then
+ echo "Main repository metadata created successfully"
+ ls -la repodata/ 2>/dev/null || echo "No repodata directory found"
+ else
+ echo "ERROR: createrepo_c failed for main repository"
+ fi
if [ -n "$GPG_FINGERPRINT" ] && [ -f repodata/repomd.xml ]; then
gpg --default-key "$GPG_FINGERPRINT" --detach-sign --armor repodata/repomd.xml 2>/dev/null || true
fi
From a905052b8a7e79630fdb0f033c2ddc354e636de3 Mon Sep 17 00:00:00 2001
From: Shuai Tian
Date: Tue, 4 Nov 2025 09:47:37 +0000
Subject: [PATCH 10/17] Add RPM processing debugging
- Show which RPM files are being processed
- Display RHEL 8/9 repository assignments
- Log final RPM repository structure
- Identify which files don't match expected patterns
---
.github/scripts/download_packages.sh | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/.github/scripts/download_packages.sh b/.github/scripts/download_packages.sh
index 96d77c6..b5e6fbf 100755
--- a/.github/scripts/download_packages.sh
+++ b/.github/scripts/download_packages.sh
@@ -130,18 +130,23 @@ for asset in data.get('assets', []):
sign_deb_package "$DEB_POOL_UBUNTU24/$clean_name"
fi
elif [[ "$filename" == *.rpm ]]; then
+ echo "Processing RPM: $filename"
wget -q -P out/packages "$download_url"
if [[ "$filename" =~ ^rhel8-postgresql[0-9]+-documentdb.*\.rpm$ ]]; then
GOT_RPM=1
mkdir -p "$RPM_POOL_RHEL8"
clean_name=$(echo "$filename" | sed 's/^rhel8-//')
+ echo " Adding to RHEL 8: $filename -> $clean_name"
cp "out/packages/$filename" "$RPM_POOL_RHEL8/$clean_name"
elif [[ "$filename" =~ ^rhel9-postgresql[0-9]+-documentdb.*\.rpm$ ]]; then
GOT_RPM=1
mkdir -p "$RPM_POOL_RHEL9"
clean_name=$(echo "$filename" | sed 's/^rhel9-//')
+ echo " Adding to RHEL 9: $filename -> $clean_name"
cp "out/packages/$filename" "$RPM_POOL_RHEL9/$clean_name"
+ else
+ echo " Skipping RPM (does not match patterns): $filename"
fi
else
wget -q -P out/packages "$download_url"
@@ -169,6 +174,16 @@ print(json.dumps(output, indent=2))
" > out/packages/release-info.json
echo "Successfully processed packages from $REPO"
+echo "GOT_DEB=$GOT_DEB, GOT_RPM=$GOT_RPM"
+echo "Checking final RPM repository structure:"
+for pool in "$RPM_POOL_RHEL8" "$RPM_POOL_RHEL9"; do
+ if [ -d "$pool" ]; then
+ echo " $pool: $(ls -1 $pool/*.rpm 2>/dev/null | wc -l) RPM files"
+ ls -la "$pool"/ 2>/dev/null || echo " Cannot list contents"
+ else
+ echo " $pool: Directory does not exist"
+ fi
+done
if [ "$GOT_DEB" = "1" ]; then
echo "Building APT repository with multiple distribution components..."
From 1d7ce4f277e29b601b998c9ab1666c2be4ea7974 Mon Sep 17 00:00:00 2001
From: Shuai Tian
Date: Tue, 4 Nov 2025 09:51:27 +0000
Subject: [PATCH 11/17] Debug YUM repository working directory issue
- Show current working directory during YUM processing
- Display actual RPM pool paths being checked
- Add more detailed directory existence and file count logging
---
.github/scripts/download_packages.sh | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/.github/scripts/download_packages.sh b/.github/scripts/download_packages.sh
index b5e6fbf..86504a6 100755
--- a/.github/scripts/download_packages.sh
+++ b/.github/scripts/download_packages.sh
@@ -341,9 +341,16 @@ fi
if [ "$GOT_RPM" = "1" ]; then
echo "Building YUM repositories..."
+ echo "Current working directory: $(pwd)"
+ echo "RPM_POOL_RHEL8=$RPM_POOL_RHEL8"
+ echo "RPM_POOL_RHEL9=$RPM_POOL_RHEL9"
for POOL in "$RPM_POOL_RHEL8" "$RPM_POOL_RHEL9"; do
- if [ -d "$POOL" ] && [ "$(find "$POOL" -name "*.rpm" -type f | wc -l)" -gt 0 ]; then
+ echo "Checking pool: $POOL"
+ if [ -d "$POOL" ]; then
+ RPM_COUNT=$(find "$POOL" -name "*.rpm" -type f | wc -l)
+ echo " Directory exists with $RPM_COUNT RPM files"
+ if [ "$RPM_COUNT" -gt 0 ]; then
echo "Processing YUM repository: $POOL"
pushd "$POOL" >/dev/null
@@ -365,9 +372,12 @@ if [ "$GOT_RPM" = "1" ]; then
gpg --default-key "$GPG_FINGERPRINT" --detach-sign --armor repodata/repomd.xml 2>/dev/null || true
fi
- popd >/dev/null
+ popd >/dev/null
+ else
+ echo " No RPM files found in directory"
+ fi
else
- echo "Skipping $POOL: directory not found or no RPM files"
+ echo " Directory does not exist: $POOL"
fi
done
From 46fe08064e753504c5c65476c5a63820ea188fda Mon Sep 17 00:00:00 2001
From: Shuai Tian
Date: Tue, 4 Nov 2025 09:55:41 +0000
Subject: [PATCH 12/17] Fix YUM repository path resolution issue
- Detect if we're in wrong directory after APT processing
- Adjust RPM pool paths when working directory is out/deb
- Use relative paths that work from the current location
- This fixes the issue where RPM directories couldn't be found
---
.github/scripts/download_packages.sh | 30 ++++++++++++++++------------
1 file changed, 17 insertions(+), 13 deletions(-)
diff --git a/.github/scripts/download_packages.sh b/.github/scripts/download_packages.sh
index 86504a6..ed6b1a1 100755
--- a/.github/scripts/download_packages.sh
+++ b/.github/scripts/download_packages.sh
@@ -341,16 +341,20 @@ fi
if [ "$GOT_RPM" = "1" ]; then
echo "Building YUM repositories..."
- echo "Current working directory: $(pwd)"
- echo "RPM_POOL_RHEL8=$RPM_POOL_RHEL8"
- echo "RPM_POOL_RHEL9=$RPM_POOL_RHEL9"
- for POOL in "$RPM_POOL_RHEL8" "$RPM_POOL_RHEL9"; do
- echo "Checking pool: $POOL"
- if [ -d "$POOL" ]; then
- RPM_COUNT=$(find "$POOL" -name "*.rpm" -type f | wc -l)
- echo " Directory exists with $RPM_COUNT RPM files"
- if [ "$RPM_COUNT" -gt 0 ]; then
+ # Adjust RPM pool paths if we're in the wrong directory after APT processing
+ if [[ "$PWD" == */out/deb ]]; then
+ RHEL8_POOL="../rpm/rhel8"
+ RHEL9_POOL="../rpm/rhel9"
+ MAIN_POOL="../rpm/main"
+ else
+ RHEL8_POOL="$RPM_POOL_RHEL8"
+ RHEL9_POOL="$RPM_POOL_RHEL9"
+ MAIN_POOL="out/rpm/main"
+ fi
+
+ for POOL in "$RHEL8_POOL" "$RHEL9_POOL"; do
+ if [ -d "$POOL" ] && [ "$(find "$POOL" -name "*.rpm" -type f | wc -l)" -gt 0 ]; then
echo "Processing YUM repository: $POOL"
pushd "$POOL" >/dev/null
@@ -382,11 +386,11 @@ if [ "$GOT_RPM" = "1" ]; then
done
# Create main repository for backward compatibility
- if [ -d "$RPM_POOL_RHEL8" ] && [ "$(find "$RPM_POOL_RHEL8" -name "*.rpm" -type f | wc -l)" -gt 0 ]; then
+ if [ -d "$RHEL8_POOL" ] && [ "$(find "$RHEL8_POOL" -name "*.rpm" -type f | wc -l)" -gt 0 ]; then
echo "Creating main YUM repository"
- mkdir -p out/rpm/main
- cp "$RPM_POOL_RHEL8"/* out/rpm/main/
- pushd out/rpm/main >/dev/null
+ mkdir -p "$MAIN_POOL"
+ cp "$RHEL8_POOL"/* "$MAIN_POOL"/
+ pushd "$MAIN_POOL" >/dev/null
echo "Running createrepo_c for main repository in $(pwd)"
if createrepo_c .; then
echo "Main repository metadata created successfully"
From 4023a47d59997cddabfa0913aa47c2d1904ade47 Mon Sep 17 00:00:00 2001
From: Shuai Tian
Date: Tue, 4 Nov 2025 10:01:41 +0000
Subject: [PATCH 13/17] Fix bash syntax error in YUM repository conditional
structure
---
.github/scripts/download_packages.sh | 7 ++-----
.github/workflows/nextjs.yml | 16 ----------------
2 files changed, 2 insertions(+), 21 deletions(-)
diff --git a/.github/scripts/download_packages.sh b/.github/scripts/download_packages.sh
index ed6b1a1..ceb4366 100755
--- a/.github/scripts/download_packages.sh
+++ b/.github/scripts/download_packages.sh
@@ -376,12 +376,9 @@ if [ "$GOT_RPM" = "1" ]; then
gpg --default-key "$GPG_FINGERPRINT" --detach-sign --armor repodata/repomd.xml 2>/dev/null || true
fi
- popd >/dev/null
- else
- echo " No RPM files found in directory"
- fi
+ popd >/dev/null
else
- echo " Directory does not exist: $POOL"
+ echo "Skipping $POOL: directory not found or no RPM files"
fi
done
diff --git a/.github/workflows/nextjs.yml b/.github/workflows/nextjs.yml
index 34b3bcc..8cb65da 100644
--- a/.github/workflows/nextjs.yml
+++ b/.github/workflows/nextjs.yml
@@ -101,22 +101,6 @@ jobs:
run: ${{ steps.detect-package-manager.outputs.runner }} next build
- name: Download DocumentDB packages from latest release
run: .github/scripts/download_packages.sh
- - name: Debug output structure
- run: |
- echo "Contents of out directory:"
- find out -type f | head -30
- echo ""
- echo "APT repository structure:"
- ls -la out/deb/ 2>/dev/null || echo "No deb directory found"
- echo ""
- echo "APT repository pools:"
- ls -la out/deb/pool/ 2>/dev/null || echo "No pool directory found"
- echo ""
- echo "YUM repository structure:"
- ls -la out/rpm/ 2>/dev/null || echo "No rpm directory found"
- echo ""
- echo "Direct download packages:"
- ls -la out/packages/*.{deb,rpm} 2>/dev/null || echo "No packages found"
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
From 97c52e9044fba8fa29c588d56b59c5b42aaae860 Mon Sep 17 00:00:00 2001
From: Shuai Tian
Date: Tue, 4 Nov 2025 10:04:34 +0000
Subject: [PATCH 14/17] Fix cp command to only copy RPM files, not directories
---
.github/scripts/download_packages.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/scripts/download_packages.sh b/.github/scripts/download_packages.sh
index ceb4366..478bf47 100755
--- a/.github/scripts/download_packages.sh
+++ b/.github/scripts/download_packages.sh
@@ -386,7 +386,7 @@ if [ "$GOT_RPM" = "1" ]; then
if [ -d "$RHEL8_POOL" ] && [ "$(find "$RHEL8_POOL" -name "*.rpm" -type f | wc -l)" -gt 0 ]; then
echo "Creating main YUM repository"
mkdir -p "$MAIN_POOL"
- cp "$RHEL8_POOL"/* "$MAIN_POOL"/
+ cp "$RHEL8_POOL"/*.rpm "$MAIN_POOL"/ 2>/dev/null || true
pushd "$MAIN_POOL" >/dev/null
echo "Running createrepo_c for main repository in $(pwd)"
if createrepo_c .; then
From 1c0550c54e7d6a6b3c40c7ae283bed87fda681ae Mon Sep 17 00:00:00 2001
From: Shuai Tian
Date: Tue, 4 Nov 2025 10:49:28 +0000
Subject: [PATCH 15/17] Fix doc
---
PACKAGE-INSTALL.md | 219 +++++++++++++++++++++++++++++++-----------
app/packages/page.tsx | 11 +--
2 files changed, 166 insertions(+), 64 deletions(-)
diff --git a/PACKAGE-INSTALL.md b/PACKAGE-INSTALL.md
index a97d48e..eca180f 100644
--- a/PACKAGE-INSTALL.md
+++ b/PACKAGE-INSTALL.md
@@ -1,40 +1,74 @@
# DocumentDB Package Installation
-Fast and simple installation of DocumentDB.
+Fast and simple installation of DocumentDB extension for PostgreSQL.
+
+**Supported PostgreSQL Versions:** 15, 16, 17
## Install Commands
### Ubuntu & Debian (AMD64 & ARM64)
```bash
-curl -fsSL https://documentdb.github.io/documentdb-archive-keyring.gpg | sudo gpg --dearmor -o /usr/share/keyrings/documentdb-archive-keyring.gpg
-echo "deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/documentdb-archive-keyring.gpg] https://documentdb.github.io/deb stable main" | sudo tee /etc/apt/sources.list.d/documentdb.list
+curl -fsSL https://documentdb.io/KEY.gpg | sudo gpg --dearmor -o /usr/share/keyrings/documentdb-archive-keyring.gpg
+echo "deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/documentdb-archive-keyring.gpg] https://documentdb.io/deb stable main" | sudo tee /etc/apt/sources.list.d/documentdb.list
sudo apt update
+
+# Install latest version for PostgreSQL 16 (recommended)
sudo apt install postgresql-16-documentdb
```
-### RHEL & CentOS (x86_64 & aarch64)
+### RHEL & CentOS (x86_64 only)
```bash
-curl -fsSL https://documentdb.github.io/documentdb-archive-keyring.gpg | sudo rpm --import -
+# Import GPG key
+sudo rpm --import https://documentdb.io/KEY.gpg
+
+# Add repository (RHEL/Rocky 9)
cat <
📖 Complete Installation Guide
- Detailed instructions for all distributions, GPG verification, troubleshooting, and automation scripts
+ Detailed instructions for all distributions, GPG verification, troubleshooting, etc