blob: f794d88ab955335162b7a1d008b0fbeadbb51f23 [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-infra"
)
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