diff --git a/containers/buildkite-premerge-debian/bootstrap_build.sh b/containers/buildkite-premerge-debian/bootstrap_build.sh index 1173b39..0f7d50a 100755 --- a/containers/buildkite-premerge-debian/bootstrap_build.sh +++ b/containers/buildkite-premerge-debian/bootstrap_build.sh @@ -18,7 +18,7 @@ steps: - label: "bootstrap" commands: - "git clone --depth 1 --branch \"${PREMERGE_SCRIPTS_BRANCH}\" https://github.com/google/llvm-premerge-checks.git" - - "llvm-premerge-checks/scripts/buildkite/create_pipeline.py | buildkite-agent pipeline upload" + - "llvm-premerge-checks/scripts/buildkite/create_pipeline.py | tee /dev/tty | buildkite-agent pipeline upload" agents: queue: "${BUILDKITE_AGENT_META_DATA_QUEUE}" os: "linux" diff --git a/scripts/buildkite/create_pipeline.py b/scripts/buildkite/create_pipeline.py index fc02422..c900c64 100755 --- a/scripts/buildkite/create_pipeline.py +++ b/scripts/buildkite/create_pipeline.py @@ -13,20 +13,24 @@ # See the License for the specific language governing permissions and # limitations under the License. +import os + if __name__ == '__main__': - print(""" -steps: - - label: "build" - commands: - - "git clone --depth 1 --branch master https://github.com/google/llvm-premerge-checks.git" - - "llvm-premerge-checks/scripts/run_buildkite.sh" - agents: - queue: "local" - os: "linux" - - label: "parallel step" - commands: - - "echo do nothing" - agents: - queue: "local" - os: "linux" - """) + script_branch = os.getenv("PREMERGE_SCRIPTS_BRANCH", "master") + queue = os.getenv("BUILDKITE_AGENT_META_DATA_QUEUE", "default") + print(f""" + steps: + - label: "build" + commands: + - "git clone --depth 1 --branch '{script_branch}' https://github.com/google/llvm-premerge-checks.git" + - "llvm-premerge-checks/scripts/run_buildkite.sh" + agents: + queue: "{queue}" + os: "linux" + - label: "parallel step" + commands: + - "echo do nothing" + agents: + queue: "{queue}" + os: "linux" + """)