1 Commits

Author SHA1 Message Date
unkinben d3a4edc67d feat: migrate to woodpeckerci
Build / build-9 (pull_request) Successful in 10s
Build / build-8 (pull_request) Successful in 10s
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build-almalinux9 Pipeline was successful
ci/woodpecker/pr/build-almalinux8 Pipeline was successful
- update build tool for kubernetes auth
- update build tool to build packages without docker (native + buildah)
- add woodpecker pre-commit and build jobs
2026-03-07 16:20:40 +11:00
+6 -25
View File
@@ -1102,37 +1102,18 @@ def build_package_buildah(
'find', '/app/dist', '-type', 'f', '-name', '*.rpm'
]
result = subprocess.run(copy_out_args, capture_output=True, text=True)
logger.debug(f"Find RPMs result: {result.stdout}")
if result.returncode == 0 and result.stdout.strip():
rpm_files = result.stdout.strip().split('\n')
logger.info(f"Found {len(rpm_files)} RPM files to copy")
for rpm_file in rpm_files:
rpm_file = rpm_file.strip()
if rpm_file:
# Use buildah mount to copy files out
mount_args = ['buildah', 'mount', container_name]
mount_result = subprocess.run(mount_args, capture_output=True, text=True)
if mount_result.returncode == 0:
container_path = mount_result.stdout.strip()
source_file = Path(container_path) / rpm_file.lstrip('/')
if source_file.exists():
import shutil
dest_file = package_dist_dir / source_file.name
shutil.copy2(source_file, dest_file)
logger.debug(f"Copied {source_file} to {dest_file}")
else:
logger.error(f"Source file not found: {source_file}")
# Unmount
subprocess.run(['buildah', 'unmount', container_name], capture_output=True)
else:
logger.error(f"Failed to mount container: {mount_result.stderr}")
else:
logger.warning(f"No RPM files found or find command failed: {result.stderr}")
copy_args = [
'buildah', 'copy', '--from', container_name,
rpm_file, str(package_dist_dir)
]
logger.debug(f"Running: {' '.join(copy_args)}")
subprocess.run(copy_args, capture_output=True, text=True)
logger.info(f"Successfully built {package_name}-{package_version}-{package_release} using Buildah")
return True