@@ -840,10 +840,17 @@ configure_local_data() { #{{{
840
840
# ECS_ENGINE_AUTH_TYPE "docker" | "dockercfg" The type of auth data that is stored in the ECS_ENGINE_AUTH_DATA key.
841
841
# ECS_ENGINE_AUTH_DATA
842
842
843
+
844
+ if [[ $RUNNER_GROUP_DOC_VERSION == " V4" ]]; then
845
+ ECS_INSTANCE_ATTRIBUTES=" {\" sg_organization\" : \" ${ORGANIZATION_NAME} \" ,\" sg_runner_id\" : \" ${RUNNER_ID} \" , \" sg_runner_group_id\" : \" ${RUNNER_GROUP_ID} \" , \" sg_runner_group_signature\" : \" ${SG_RUNNER_GROUP_SIGNATURE} \" }"
846
+ else
847
+ ECS_INSTANCE_ATTRIBUTES=" {\" sg_organization\" : \" ${ORGANIZATION_NAME} \" ,\" sg_runner_id\" : \" ${RUNNER_ID} \" , \" sg_runner_group_id\" : \" ${RUNNER_GROUP_ID} \" }"
848
+ fi
849
+
843
850
cat > /etc/ecs/ecs.config << EOF
844
851
ECS_CLUSTER=${ECS_CLUSTER}
845
852
AWS_DEFAULT_REGION=${LOCAL_AWS_DEFAULT_REGION}
846
- ECS_INSTANCE_ATTRIBUTES={"sg_organization": " ${ORGANIZATION_NAME} ","sg_runner_id": " ${RUNNER_ID} ", "sg_runner_group_id": " ${RUNNER_GROUP_ID} " }
853
+ ECS_INSTANCE_ATTRIBUTES=${ECS_INSTANCE_ATTRIBUTES }
847
854
ECS_LOGLEVEL=info
848
855
ECS_DISABLE_PRIVILEGED=false
849
856
ECS_ENABLE_UNTRACKED_IMAGE_CLEANUP=true
@@ -1028,6 +1035,8 @@ fetch_organization_info() { #{{{
1028
1035
RUNNER_ID=" $( echo " ${response} " | jq -r ' .data.RunnerId' ) "
1029
1036
RUNNER_GROUP_ID=" $( echo " ${response} " | jq -r ' .data.RunnerGroupId' ) "
1030
1037
RUNNER_GROUP_ID=" ${RUNNER_GROUP_ID##*/ } "
1038
+ RUNNER_GROUP_DOC_VERSION=" $( echo " ${response} " | jq -r ' .data.RunnerGroup.DocVersion // empty' ) "
1039
+ SG_RUNNER_GROUP_SIGNATURE=" $( echo " ${response} " | jq -r ' .data.RunnerGroup.RunnerGroupSignature // empty' ) "
1031
1040
# TAGS="$(echo "${response}" | jq -r '.data.Tags')"
1032
1041
STORAGE_ACCOUNT_NAME=" $( echo " ${response} " | jq -r ' .data.RunnerGroup.StorageBackendConfig.azureBlobStorageAccountName // empty' ) "
1033
1042
SHARED_KEY=" $( echo " ${response} " | jq -r ' .data.RunnerGroup.StorageBackendConfig.azureBlobStorageAccessKey // empty' ) "
0 commit comments