blob: bdc47ef69f32f38685c32b101607d50f5320541c [file] [log] [blame]
#!/usr/bin/env lucicfg
# Copyright 2020 The Flutter Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Configurations for the plugins repository.
"""
load("//lib/ci_yaml/ci_yaml.star", "ci_yaml")
load("//lib/common.star", "common")
load("//lib/repos.star", "repos")
load("//lib/timeout.star", "timeout")
load("//lib/release_branches/release_branches.star", "release_branches")
def _setup():
"""Set default configurations for builders, and setup recipes."""
plugins_product_tagged_config_setup()
ci_yaml.generate("plugins", "main", None, "refs/heads/main", {}, {}, recipes_ref = release_branches.main.recipes_ref)
def plugins_product_tagged_config_setup():
"""Builder configures for prod tasks, which were only triggered with tag changes."""
platform_args = {
"linux": {
"os": "Linux",
},
}
luci.recipe(
name = "plugins/plugins_publish",
cipd_package = "flutter/recipe_bundles/flutter.googlesource.com/recipes",
cipd_version = "refs/heads/main",
)
trigger_name = "gitiles-trigger-plugins-tagged"
ref = "refs/tags/.+"
# poll for any tags change
luci.gitiles_poller(
name = trigger_name,
bucket = "prod",
repo = repos.GIT_REMOTE["plugins"],
refs = [ref],
)
console_view_name = "plugins_tagged"
luci.console_view(
name = console_view_name,
repo = repos.GIT_REMOTE["plugins"],
refs = [ref],
)
publish_recipe_name = "plugins/plugins_publish"
# Defines builders
common.linux_prod_builder(
name = "Linux Publish Plugins|publish",
recipe = publish_recipe_name,
console_view_name = console_view_name,
triggered_by = [trigger_name],
execution_timeout = timeout.SHORT,
**platform_args["linux"]
)
plugins_config = struct(setup = _setup)