Instead of bind-mounting each individual input into the container,
create a temporary directory that is used by all inputs and bind-
mount this to the well known location ("/run/osbuild/inputs"). The
temporary directory is then passed to the input so that it can
make the requested resources available relative to that directory.
This is enforced by the common input handling code.
Additionally, pass the well known input path via a new "paths" key
to the arguments dictionary passed to the stage.
37 lines
549 B
Python
Executable file
37 lines
549 B
Python
Executable file
#!/usr/bin/python3
|
|
"""
|
|
No-op inputs
|
|
|
|
Does nothing with the supplied data but just forwards
|
|
it to the stage.
|
|
"""
|
|
|
|
|
|
import json
|
|
import os
|
|
import sys
|
|
import uuid
|
|
|
|
|
|
SCHEMA = """
|
|
"additionalProperties": true
|
|
"""
|
|
|
|
|
|
def main():
|
|
args = json.load(sys.stdin)
|
|
refs = args["refs"]
|
|
target = args["target"]
|
|
|
|
uid = str(uuid.uuid4())
|
|
path = os.path.join(target, uid)
|
|
os.makedirs(path)
|
|
|
|
data = {"path": path, "data": {"refs": refs}}
|
|
json.dump(data, sys.stdout)
|
|
return 0
|
|
|
|
|
|
if __name__ == '__main__':
|
|
r = main()
|
|
sys.exit(r)
|