Skip to content

feat(scaletest/templates): add repo branch parameter #10279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat(scaletest/templates): add repo branch parameter
  • Loading branch information
mafredri committed Oct 16, 2023
commit f4fedc5a981b904b3979b703ee2b3c9048a8566a
10 changes: 10 additions & 0 deletions scaletest/templates/scaletest-runner/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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."
mutable = true
}

data "coder_parameter" "create_concurrency" {
order = 10
type = "number"
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion scaletest/templates/scaletest-runner/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down