[dart_ci] Add a script to schedule builders for script executables
The dart_ci builder scripts (one at the moment) in dart_ci/builder
are run as platform specific executables from the Dart recipe module.
The executables are built using LUCI builders (one per architecture
required).
This script schedules a run of these builders for the given commit
of the form https://dart.googlesource.com/dart_ci/+/<commitish>.
Change-Id: I053d2453cd0273f19298f8c30b2650adc2472557
Reviewed-on: https://dart-review.googlesource.com/c/dart_ci/+/203883
Reviewed-by: Alexander Thomas <athom@google.com>
Commit-Queue: Karl Klose <karlklose@google.com>
diff --git a/builder/tools/build_executables.sh b/builder/tools/build_executables.sh
new file mode 100755
index 0000000..65ad4a4
--- /dev/null
+++ b/builder/tools/build_executables.sh
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+
+# Copyright (c) 2021, the Dart project authors. Please see the AUTHORS file
+# for details. All rights reserved. Use of this source code is governed by a
+# BSD-style license that can be found in the LICENSE file.
+
+# Schedules builders to build executables from the dart_ci scripts for all
+# supported platforms and upload them as CIPD packages under
+# https://chrome-infra-packages.appspot.com/p/dart/ci/builder_scripts.
+
+set -e
+
+if [ -z "$1" ]; then
+ echo "Revision required as first argument." >&2
+ exit 1
+fi
+
+declare -a BUILDERS=(
+ "dart-ci-scripts-linux"
+ "dart-ci-scripts-win"
+ "dart-ci-scripts-mac"
+ "dart-ci-scripts-mac-arm64")
+
+for INDEX in "${!BUILDERS[@]}"; do
+ BUILDER=dart/ci/${BUILDERS[$INDEX]}
+ BUILD_ID=$(bb add\
+ -commit $1\
+ -json\
+ $BUILDER\
+ | jq -r '.id')
+ echo $BUILDER: $BUILD_ID
+done