blob: ba779ae966d6041da79aab54e4617265542a3871 [file] [log] [blame]
# Copyright 2018 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from recipe_engine.post_process import Filter
DEPS = [
'dart',
'depot_tools/git',
'recipe_engine/cipd',
'recipe_engine/context',
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/step',
]
def RunSteps(api):
version = api.properties.get('version')
api.git.checkout(url='https://github.com/dart-lang/dart_docker.git')
cipd_ensure_file = api.cipd.EnsureFile()
cipd_ensure_file.add_package('dart/dart-sdk/${platform}', 'stable')
api.cipd.ensure(api.path['cleanup'].join('sdk'), cipd_ensure_file)
env = {
'DOCKER_CONFIG': api.path['cleanup'].join('.docker'),
}
with api.context(cwd=api.path['cleanup'], env=env):
dockerhub_key = api.dart.get_secret('dockerhub')
login = [
'/bin/bash',
'-c',
'cat %s | /usr/bin/docker login --username dartbot --password-stdin'
% dockerhub_key]
api.step('docker login', login)
env_prefixes = {
'PATH': [api.path['cleanup'].join('sdk').join('dart-sdk').join('bin')],
}
build_push = (api.path['start_dir']
.join('dart_docker')
.join('build_push.sh'))
with api.context(env=env, env_prefixes=env_prefixes):
api.step('build and push', [build_push, 'google', version])
def GenTests(api):
yield api.test(
'release',
api.properties.generic(version='1.24.3'),
)