feat: snapshot Linux-first RMM MVP and pause handover
Rust development slice / linux (push) Failing after 1m10s
Rust development slice / linux (push) Failing after 1m10s
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
#!/usr/bin/python3
|
||||
"""Build pinned script-free .deb artifacts; NEVER install or publish them."""
|
||||
import importlib.util
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
import stat
|
||||
import sys
|
||||
|
||||
sys.dont_write_bytecode = True
|
||||
SPEC = importlib.util.spec_from_file_location('apt_transaction',
|
||||
Path(__file__).with_name('apt_transaction.py'))
|
||||
apt = importlib.util.module_from_spec(SPEC)
|
||||
sys.modules[SPEC.name] = apt
|
||||
SPEC.loader.exec_module(apt)
|
||||
|
||||
|
||||
def build(output):
|
||||
output = Path(output).resolve(strict=True)
|
||||
st = output.stat()
|
||||
if not stat.S_ISDIR(st.st_mode) or st.st_uid != os.getuid() or st.st_mode & 0o077:
|
||||
raise ValueError('output must be an owned private directory')
|
||||
records = []
|
||||
for version in ('1.0', '1.1'):
|
||||
destination = output / ('rmm-mvp-test_' + version + '_all.deb')
|
||||
data = apt.fixture_archive(version)
|
||||
apt.require(apt.digest(data) == apt.FIXTURE_SHA256[version], 'FIXTURE_PINNED_BYTES')
|
||||
with destination.open('xb') as stream:
|
||||
stream.write(data)
|
||||
records.append({'name': 'rmm-mvp-test', 'new_version': version,
|
||||
'architecture': 'all', 'origin': 'rmm-test',
|
||||
'sha256': apt.digest(data), 'size': len(data),
|
||||
'local_build_path': str(destination)})
|
||||
return records
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) != 2:
|
||||
sys.exit('usage: build_fixture.py EXISTING_PRIVATE_OUTPUT_DIRECTORY')
|
||||
print(json.dumps(build(sys.argv[1]), indent=2))
|
||||
Reference in New Issue
Block a user