blob: a1a595b10f965df7c8b47fb97cd069515ac9222c [file] [log] [blame]
#!/usr/bin/env bash
# Copyright 2021 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
set -eu -o pipefail
declare -A repos_and_builders=(
["cobalt"]="tricium-cobalt"
["fuchsia"]="tricium"
["infra/recipes"]="tricium-recipes"
["tools"]="tricium-tools"
)
validate=false
while getopts v opt; do
case "$opt" in
v)
# Use the -v flag to run `lucicfg validate` instead of `lucicfg
# generate`.
validate=true
;;
\?)
exit 2
;;
esac
done
for repo in "${!repos_and_builders[@]}"; do
builder="${repos_and_builders[$repo]}"
cmd="generate"
if $validate; then
cmd="validate"
fi
lucicfg "$cmd" -var repo="$repo" -var builder="$builder" main.star
done