Skip to content

Commit

Permalink
Added support for CASE_SENSITIVE setting (aws-games#313)
Browse files Browse the repository at this point in the history
Co-authored-by: Kyle Somers <[email protected]>
  • Loading branch information
keith-miller and kylesomers authored Sep 26, 2024
1 parent a48c08f commit 3b5be91
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion assets/packer/perforce/helix-core/p4_configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,12 @@ print_help() {
echo " --hx_logs <path> Path for Helix Core logs"
echo " --hx_metadata <path> Path for Helix Core metadata"
echo " --hx_depots <path> Path for Helix Core depots"
echo " --case_sensitive <0/1> Set the case sensitivity of the Helix Core server"
echo " --help Display this help and exit"
}

# Parse command-line options
OPTS=$(getopt -o '' --long p4d_type:,username:,password:,auth:,fqdn:,hx_logs:,hx_metadata:,hx_depots:,help -n 'parse-options' -- "$@")
OPTS=$(getopt -o '' --long p4d_type:,username:,password:,auth:,fqdn:,hx_logs:,hx_metadata:,hx_depots:,case_sensitive:,help -n 'parse-options' -- "$@")

if [ $? != 0 ]; then
log_message "Failed to parse options"
Expand Down Expand Up @@ -197,6 +198,11 @@ while true; do
log_message "EBS_DEPOTS: $EBS_DEPOTS"
shift 2
;;
--case_sensitive)
CASE_SENSITIVE="$2"
log_message "CASE_SENSITIVE: $CASE_SENSITIVE"
shift 2
;;
--help)
print_help
exit 0
Expand Down Expand Up @@ -355,6 +361,10 @@ sed -i "s/^P4MASTERHOST=.*/P4MASTERHOST=$EC2_DNS_PRIVATE/" "$SDP_Setup_Script_Co

log_message "Updated P4MASTERHOST to $EC2_DNS_PRIVATE in $SDP_Setup_Script_Config."

# Update Perforce case_sensitivity in configuration
sed -i "s/^CASE_SENSITIVE=.*/CASE_SENSITIVE=CASE_SENSITIVE/" "$SDP_Setup_Script_Config"

log_message "Updated CASE_SENSITIVE in $SDP_Setup_Script_Config."

log_message "Mounting done ok - continue to the install"

Expand Down
3 changes: 2 additions & 1 deletion modules/perforce/helix-core/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ resource "aws_instance" "helix_core_instance" {
--username ${var.helix_core_super_user_username_secret_arn == null ? awscc_secretsmanager_secret.helix_core_super_user_username[0].secret_id : var.helix_core_super_user_username_secret_arn} \
--password ${var.helix_core_super_user_password_secret_arn == null ? awscc_secretsmanager_secret.helix_core_super_user_password[0].secret_id : var.helix_core_super_user_password_secret_arn} \
--fqdn ${var.FQDN == null ? "" : var.FQDN} \
--auth ${var.helix_authentication_service_url == null ? "" : var.helix_authentication_service_url}
--auth ${var.helix_authentication_service_url == null ? "" : var.helix_authentication_service_url} \
--case_sensitive ${var.helix_case_sensitive ? 1 : 0}
EOT


Expand Down
9 changes: 9 additions & 0 deletions modules/perforce/helix-core/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,12 @@ variable "helix_authentication_service_url" {
description = "The URL for the Helix Authentication Service."
default = null
}

########################################
# Helix Core settings
########################################
variable "helix_case_sensitive" {
type = bool
description = "Whether or not the server should be case insensitive (Server will run '-C1' mode), or if the server will run with case sensitivity default of the underlying platform. False enables '-C1' mode"
default = true
}

0 comments on commit 3b5be91

Please sign in to comment.