online bottlenecks soak throughtputs
[releng.git] / jjb / apex / apex-jjb-renderer.py
1 ##############################################################################
2 # Copyright (c) 2016 Tim Rozet (trozet@redhat.com) and others.
3 #
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9
10 import pprint
11 import yaml
12 from jinja2 import Environment
13 from jinja2 import FileSystemLoader
14
15 gspathname = dict()
16 branch = dict()
17 build_slave = dict()
18 env = Environment(loader=FileSystemLoader('./'), autoescape=True)
19
20 with open('scenarios.yaml.hidden') as _:
21     scenarios = yaml.safe_load(_)
22
23 template = env.get_template('apex.yml.j2')
24
25 print("Scenarios are: ")
26 pprint.pprint(scenarios)
27
28 for stream in scenarios:
29     if stream == 'master':
30         gspathname['master'] = ''
31         branch[stream] = stream
32     else:
33         gspathname[stream] = '/' + stream
34         branch[stream] = 'stable/' + stream
35     build_slave[stream] = 'apex-baremetal-{}'.format(stream)
36
37 output = template.render(scenarios=scenarios, gspathname=gspathname,
38                          branch=branch, build_slave=build_slave)
39
40 with open('./apex.yml', 'w') as fh:
41     fh.write(output)