File size: 686 Bytes
26b3a9d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python3
"""Verify a materialized APM artifact against an immutable expected state."""

import argparse
from pathlib import Path

from anchorstep.weights.verify import verify_logical_state


def main() -> int:
    parser = argparse.ArgumentParser()
    parser.add_argument("--base", type=Path, required=True)
    parser.add_argument("--artifact", type=Path, required=True)
    parser.add_argument("--expected", type=Path, required=True)
    args = parser.parse_args()
    report = verify_logical_state(args.base, args.artifact, args.expected)
    print(report.materialized_digest)
    return 0 if report.ok else 1


if __name__ == "__main__":
    raise SystemExit(main())