flowey_hvlite/pipelines_shared/
ado_flowey_bootstrap_template.rs

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4//! See [`get_template_ado`]
5
6use flowey::node::prelude::AdoResourcesRepositoryId;
7
8/// Get our internal flowey bootstrap template.
9///
10/// See [`Pipeline::ado_set_flowey_bootstrap_template`]
11///
12/// [`Pipeline::ado_set_flowey_bootstrap_template`]:
13///     flowey::pipeline::prelude::Pipeline::ado_set_flowey_bootstrap_template
14pub fn get_template_ado(ado_hvlite_repo_resource_id: &AdoResourcesRepositoryId) -> String {
15    // to be clear: these replaces are totally custom to this particular
16    // bootstrap template. flowey knows nothing of these replacements.
17    include_str!("ado_flowey_bootstrap_template.yml")
18        .to_string()
19        // not actually used today, but will be used the moment pipelines live
20        // in a repo that doesn't also contain all flowey source code as well.
21        .replace(
22            "{{FLOWEY_ADO_REPO_ID}}",
23            ado_hvlite_repo_resource_id.dangerous_get_raw_id(),
24        )
25        .replace(
26            "{{RUSTUP_TOOLCHAIN}}",
27            flowey_lib_hvlite::cfg_rustup_version::RUSTUP_TOOLCHAIN,
28        )
29}