summaryrefslogtreecommitdiff
path: root/source/ciat_deployer.py
blob: 1e9782b7100026d0ee3c4cf8d4aa8063353f9d83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
BUILT_SYSTEMS_FILE = "built_systems.yaml"

def buildcomplete(properties):
    import yaml, os
    global BUILT_SYSTEMS_FILE

    system = {
            'name': properties['system'],
            'slave': properties['slave'],
            'definitions_sha': properties['definitions_sha']}

    if os.path.isfile(BUILT_SYSTEMS_FILE):
        with open(BUILT_SYSTEMS_FILE, 'r') as f:
            built_systems = yaml.load(f)
    else:
        built_systems = []
    if system in built_systems:
        return
    built_systems.append(system)
    with open(BUILT_SYSTEMS_FILE, 'w') as f:
        outfile.write(yaml.dump(build_systems,default_flow_style=False))