mirror of https://github.com/coder/coder.git
feat(scaletest/templates): add repo branch parameter (#10279)
This commit is contained in:
parent
dd86100f33
commit
493e2bd2ac
|
@ -75,6 +75,15 @@ data "coder_parameter" "dry_run" {
|
|||
ephemeral = true
|
||||
}
|
||||
|
||||
data "coder_parameter" "repo_branch" {
|
||||
order = 3
|
||||
type = "string"
|
||||
name = "Branch"
|
||||
default = "main"
|
||||
description = "Branch of coder/coder repo to check out (only useful for developing the runner)."
|
||||
mutable = true
|
||||
}
|
||||
|
||||
data "coder_parameter" "create_concurrency" {
|
||||
order = 10
|
||||
type = "number"
|
||||
|
@ -357,6 +366,7 @@ resource "coder_agent" "main" {
|
|||
SCALETEST_RUN_DIR : local.scaletest_run_dir,
|
||||
|
||||
SCALETEST_PARAM_TEMPLATE : data.coder_parameter.workspace_template.value,
|
||||
SCALETEST_PARAM_REPO_BRANCH : data.coder_parameter.repo_branch.value,
|
||||
SCALETEST_PARAM_NUM_WORKSPACES : data.coder_parameter.num_workspaces.value,
|
||||
SCALETEST_PARAM_CREATE_CONCURRENCY : "${data.coder_parameter.create_concurrency.value}",
|
||||
SCALETEST_PARAM_CLEANUP_STRATEGY : data.coder_parameter.cleanup_strategy.value,
|
||||
|
|
|
@ -16,7 +16,7 @@ echo "Cloning coder/coder repo..."
|
|||
if [[ ! -d "${HOME}/coder" ]]; then
|
||||
git clone https://github.com/coder/coder.git "${HOME}/coder"
|
||||
fi
|
||||
(cd "${HOME}/coder" && git pull)
|
||||
(cd "${HOME}/coder" && git fetch -a && git checkout "${SCALETEST_PARAM_REPO_BRANCH}" && git pull)
|
||||
|
||||
# shellcheck disable=SC2153 source=scaletest/templates/scaletest-runner/scripts/lib.sh
|
||||
. "${SCRIPTS_DIR}/lib.sh"
|
||||
|
|
Loading…
Reference in New Issue