in ftl/cached/ftl_cached_yaml.py [0:0]
def main():
args = parser.parse_args()
app_dir_1 = _APP_MAP[args.runtime][0]
app_dir_2 = _APP_MAP[args.runtime][1]
path = 'gcr.io/%s/%s/cache/%s' % (args.project, args.runtime, app_dir_1)
offset = _APP_MAP[args.runtime][2]
should_cache = _APP_MAP[args.runtime][3]
args.runtime = args.runtime.split('-')[0]
name = path + ':latest'
cloudbuild_yaml = {
'steps': [
# We need to chmod in some cases for permissions.
{
'name': 'ubuntu',
'args': ['chmod', 'a+rx', '-R', '/workspace']
},
# Build the runtime builder par file
{
'name': 'gcr.io/cloud-builders/bazel@sha256:7360c36bded15db68a35cfb1740a994f0a09ad5ce378a97f96d698bc223e442a',
'args': ['build', 'ftl:%s_builder.par' % args.runtime]
},
# Run the cache test
{
'name':
'gcr.io/cloud-builders/bazel@sha256:7360c36bded15db68a35cfb1740a994f0a09ad5ce378a97f96d698bc223e442a',
'args':
['run',
_BAZEL_TEMPLATE.format(args.runtime), '--', '--norun'],
},
{
'name':
_IMG_TEMPLATE.format(args.runtime),
'args': [
'--base', _BASE_MAP[args.runtime], '--name', name,
'--directory',
os.path.join(_TEST_TEMPLATE % args.runtime,
app_dir_1),
'--dir-1',
os.path.join(_TEST_TEMPLATE % args.runtime,
app_dir_1),
'--dir-2',
os.path.join(_TEST_TEMPLATE % args.runtime,
app_dir_2),
'--layer-offset', offset,
'--should-cache', should_cache
]
},
]
}
print yaml.dump(cloudbuild_yaml)