#!/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

Add a script to schedule builders for script executables
[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 <29642742b6693024c89de8232f2e2542cf7eedf7@google.com>
Commit-Queue: Karl Klose <49bc0b76cffb0b10cd8c84f9cabc97a31ffe6343@google.com>
