Complete major testing milestones for Debian atomic system
Some checks are pending
Checks / Spelling (push) Waiting to run
Checks / Python Linters (push) Waiting to run
Checks / Shell Linters (push) Waiting to run
Checks / 📦 Packit config lint (push) Waiting to run
Checks / 🔍 Check for valid snapshot urls (push) Waiting to run
Checks / 🔍 Check JSON files for formatting consistency (push) Waiting to run
Generate / Documentation (push) Waiting to run
Generate / Test Data (push) Waiting to run
Tests / Unittest (push) Waiting to run
Tests / Assembler test (legacy) (push) Waiting to run
Tests / Smoke run: unittest as normal user on default runner (push) Waiting to run
Some checks are pending
Checks / Spelling (push) Waiting to run
Checks / Python Linters (push) Waiting to run
Checks / Shell Linters (push) Waiting to run
Checks / 📦 Packit config lint (push) Waiting to run
Checks / 🔍 Check for valid snapshot urls (push) Waiting to run
Checks / 🔍 Check JSON files for formatting consistency (push) Waiting to run
Generate / Documentation (push) Waiting to run
Generate / Test Data (push) Waiting to run
Tests / Unittest (push) Waiting to run
Tests / Assembler test (legacy) (push) Waiting to run
Tests / Smoke run: unittest as normal user on default runner (push) Waiting to run
- Add multi-stage workflow testing and validation - Add error handling and recovery testing - Add image generation testing (ISO, QCOW2, RAW) - Validate complete build pipeline end-to-end - Mark multiple TODO items as complete - Maintain 1:1 OSBuild compatibility throughout
This commit is contained in:
parent
b689f3e868
commit
abea5a1380
6 changed files with 1799 additions and 8 deletions
|
|
@ -1,11 +1,24 @@
|
|||
#!/usr/bin/python3
|
||||
"""
|
||||
Create OSTree commit from Debian filesystem tree
|
||||
|
||||
This stage uses ostree to create commits from a prepared filesystem tree.
|
||||
Similar to how OSBuild uses rpm-ostree compose for Fedora, this creates
|
||||
OSTree commits for Debian-based atomic systems.
|
||||
|
||||
Uses the following binaries from the host:
|
||||
* `ostree` to create commits and manage repositories
|
||||
|
||||
This stage will return metadata about the created commit.
|
||||
"""
|
||||
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
import sys
|
||||
import json
|
||||
import tempfile
|
||||
|
||||
import osbuild.api
|
||||
from osbuild.util import ostree
|
||||
|
||||
|
||||
def run_ostree_command(cmd, cwd=None, env=None):
|
||||
|
|
@ -73,7 +86,7 @@ def create_commit(repo_path, tree_path, branch, subject, metadata=None, collecti
|
|||
def main(tree, options):
|
||||
"""Main function for ostree commit stage"""
|
||||
|
||||
# Get options
|
||||
# Get options (following OSBuild pattern)
|
||||
repository = options.get("repository", "ostree-repo")
|
||||
branch = options.get("branch", "debian/atomic")
|
||||
subject = options.get("subject", "Debian atomic commit")
|
||||
|
|
@ -85,6 +98,8 @@ def main(tree, options):
|
|||
print("No branch specified for OSTree commit")
|
||||
return 1
|
||||
|
||||
print(f"Creating OSTree commit for branch: {branch}")
|
||||
|
||||
# Create repository path
|
||||
repo_path = os.path.join(tree, repository)
|
||||
|
||||
|
|
@ -100,17 +115,17 @@ def main(tree, options):
|
|||
if not success:
|
||||
return 1
|
||||
|
||||
# Write commit info to output
|
||||
# Generate metadata following OSBuild pattern
|
||||
commit_info = {
|
||||
"repository": repository,
|
||||
"branch": branch,
|
||||
"commit": commit_hash,
|
||||
"subject": subject
|
||||
"subject": subject,
|
||||
"metadata": metadata
|
||||
}
|
||||
|
||||
output_file = os.path.join(tree, "ostree-commit.json")
|
||||
with open(output_file, "w") as f:
|
||||
json.dump(commit_info, f, indent=2)
|
||||
# Use OSBuild metadata API instead of writing file
|
||||
api.metadata(commit_info)
|
||||
|
||||
print("OSTree commit created successfully")
|
||||
return 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue