Skip to content

Commit 535f5c2

Browse files
committed
Use dynamic ref name
1 parent b02bfdb commit 535f5c2

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

cmd/generate-release/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ func freshCluster(deployerImage string) []*cloudbuild.BuildStep {
170170
"${_MACHINE_TYPE}",
171171
"${_NETWORK}",
172172
"${_RELEASE_CHANNEL}",
173+
"${REF_NAME}",
173174
},
174175
},
175176
{

cmd/generate-release/main_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ func TestFreshCluster(t *testing.T) {
196196
"${_MACHINE_TYPE}",
197197
"${_NETWORK}",
198198
"${_RELEASE_CHANNEL}",
199+
"${REF_NAME}",
199200
},
200201
}, b.Steps[1])
201202

cmd/generate-release/scripts/create-im-deployment.bash

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ node_count=$4
2626
machine_type=$5
2727
network=$6
2828
release_channel=$7
29+
repo_ref=$8
2930
image_type="cos_containerd"
3031

3132
if
@@ -35,14 +36,14 @@ if
3536
[ -z "${node_count}" ] ||
3637
[ -z "${machine_type}" ] ||
3738
[ -z "${network}" ] ||
38-
[ -z "${release_channel}" ]
39+
[ -z "${release_channel}" ] ||
40+
[ -z "${repo_ref}" ]
3941
then
40-
echo "usage: $0 [PROJECT_ID] [CLOUDSDK_CONTAINER_CLUSTER] [CLOUDSDK_COMPUTE_ZONE] [NODE_COUNT] [MACHINE_TYPE] [NETWORK] [RELEASE_CHANNEL]"
42+
echo "usage: $0 [PROJECT_ID] [CLOUDSDK_CONTAINER_CLUSTER] [CLOUDSDK_COMPUTE_ZONE] [NODE_COUNT] [MACHINE_TYPE] [NETWORK] [RELEASE_CHANNEL] [REPO_REF]"
4143
exit 1
4244
fi
4345

4446
REPO_URL="https://github.com/google/kf"
45-
REPO_BRANCH="main"
4647
TERRAFORM_DIR="cmd/generate-release/scripts/"
4748
DEPLOYMENT_ZONE="us-central1"
4849
SERVICE_ACCOUNT="infra-manager-sa@${project_id}.iam.gserviceaccount.com"
@@ -51,7 +52,7 @@ gcloud infra-manager deployments apply "projects/${project_id}/locations/${DEPLO
5152
--service-account="projects/${project_id}/serviceAccounts/${SERVICE_ACCOUNT}" \
5253
--git-source-repo="${REPO_URL}" \
5354
--git-source-directory=${TERRAFORM_DIR} \
54-
--git-source-ref=${REPO_BRANCH} \
55+
--git-source-ref=${repo_ref} \
5556
--input-values=project_id=${project_id},deployment_name=${cluster},zone=${zone},network=${network},initial_node_count=${node_count},machine_type=${machine_type},image_type=${image_type},release_channel=${release_channel}
5657

5758
echo "IM deployment created."

0 commit comments

Comments
 (0)