Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
34 changes: 32 additions & 2 deletions scripts/linux-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ IMAGE_NAME="self-hosted-operator"
DEFAULT_ENV="ea" # Default environment as per the release state. Change this value as release progress.
DEFAULT_OPERATION="install"
DEFAULT_USE_ACR="false" # Temporary backward compatibility for Azure ACR
DEFAULT_PEGASUS_ENABLED="false" # Enable Pegasus features

# Environment-specific settings
ECR_ALIAS_GA="j0s5s8b0/ga" # GA ECR alias
Expand All @@ -26,6 +27,7 @@ SHO_VERSION=""
ENV="$DEFAULT_ENV"
OPERATION="$DEFAULT_OPERATION"
USE_ACR="$DEFAULT_USE_ACR"
PEGASUS_ENABLED="$DEFAULT_PEGASUS_ENABLED"

# Derived configuration (set by setup_environment)
ECR_ALIAS=""
Expand Down Expand Up @@ -72,6 +74,8 @@ OPTIONS:
--operation=OPERATION Operation: install, uninstall, get-console-url (default: install)
--use-acr=BOOLEAN Use ACR registry: true, false (default: false)
[TEMPORARY: Backward compatibility for Azure ACR]
--pegasus-enabled=BOOLEAN Enable Pegasus features: true, false (default: false)
Note: Only supported in test environment
--help, -h Show this help message

OPERATIONS:
Expand Down Expand Up @@ -146,6 +150,13 @@ validate_arguments() {
log_success "Version '$SHO_VERSION' format is valid"
fi

# Validate Pegasus configuration
if [[ "$PEGASUS_ENABLED" == "true" && "$ENV" != "test" ]]; then
log_error "Pegasus features (--pegasus-enabled=true) are only supported in 'test' environment"
log_info "Current environment: $ENV"
return 1
fi

# Validate ACR configuration only for install operation
if [[ "$USE_ACR" == "true" ]]; then
if [[ "$OPERATION" == "install" ]]; then
Expand Down Expand Up @@ -215,6 +226,23 @@ parse_arguments() {
USE_ACR="true"
log_info "ACR registry mode enabled"
;;
--pegasus-enabled=*)
PEGASUS_ENABLED="${1#*=}"
# Normalize boolean values
case "$(echo "${PEGASUS_ENABLED}" | tr '[:upper:]' '[:lower:]')" in
true|1|yes|on)
PEGASUS_ENABLED="true"
log_info "Pegasus features enabled"
;;
false|0|no|off)
PEGASUS_ENABLED="false"
;;
*)
log_error "Invalid value for --pegasus-enabled: '$PEGASUS_ENABLED'. Must be true or false"
exit 1
;;
esac
;;
--help|-h)
show_usage
exit 0
Expand Down Expand Up @@ -539,7 +567,8 @@ sho_install() {
--set "registry.url=${SH_REGISTRY}" \
--set "registry.username=${SP_ID}" \
--set "registry.password=${SP_SECRET}" \
--set "enableECR.enabled=false" 2>&1)
--set "enableECR.enabled=false" \
--set "pegasusEnabled=$PEGASUS_ENABLED" 2>&1)
else
install_output=$(helm upgrade --install "${CHART_NAME}" "${chart_file}" \
--namespace "$NAMESPACE" \
Expand All @@ -548,7 +577,8 @@ sho_install() {
--set "image.repository=${IMAGE_NAME}" \
--set "image.tag=v${SHO_VERSION}" \
--set-string "podAnnotations.timestamp=$timestamp" \
--set "ring=$ENV" 2>&1)
--set "ring=$ENV" \
--set "pegasusEnabled=$PEGASUS_ENABLED" 2>&1)
fi

if [[ $? -eq 0 ]]; then
Expand Down
34 changes: 32 additions & 2 deletions scripts/macos-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ IMAGE_NAME="self-hosted-operator"
DEFAULT_ENV="ea" # Default environment as per the release state. Change this value as release progress.
DEFAULT_OPERATION="install"
DEFAULT_USE_ACR="false" # Temporary backward compatibility for Azure ACR
DEFAULT_PEGASUS_ENABLED="false" # Enable Pegasus features

# Environment-specific settings
ECR_ALIAS_GA="j0s5s8b0/ga" # GA ECR alias
Expand All @@ -26,6 +27,7 @@ SHO_VERSION=""
ENV="$DEFAULT_ENV"
OPERATION="$DEFAULT_OPERATION"
USE_ACR="$DEFAULT_USE_ACR"
PEGASUS_ENABLED="$DEFAULT_PEGASUS_ENABLED"

# Derived configuration (set by setup_environment)
ECR_ALIAS=""
Expand Down Expand Up @@ -75,6 +77,8 @@ OPTIONS:
--operation=OPERATION Operation: install, uninstall, get-console-url (default: install)
--use-acr=BOOLEAN Use ACR registry: true, false (default: false)
[TEMPORARY: Backward compatibility for Azure ACR]
--pegasus-enabled=BOOLEAN Enable Pegasus features: true, false (default: false)
Note: Only supported in test environment
--help, -h Show this help message

OPERATIONS:
Expand Down Expand Up @@ -150,6 +154,13 @@ validate_arguments() {
log_success "Version '$SHO_VERSION' format is valid"
fi

# Validate Pegasus configuration
if [[ "$PEGASUS_ENABLED" == "true" && "$ENV" != "test" ]]; then
log_error "Pegasus features (--pegasus-enabled=true) are only supported in 'test' environment"
log_info "Current environment: $ENV"
return 1
fi

# Validate ACR configuration only for install operation
if [[ "$USE_ACR" == "true" ]]; then
if [[ "$OPERATION" == "install" ]]; then
Expand Down Expand Up @@ -219,6 +230,23 @@ parse_arguments() {
USE_ACR="true"
log_info "ACR registry mode enabled"
;;
--pegasus-enabled=*)
PEGASUS_ENABLED="${1#*=}"
# Normalize boolean values
case "$(echo "${PEGASUS_ENABLED}" | tr '[:upper:]' '[:lower:]')" in
true|1|yes|on)
PEGASUS_ENABLED="true"
log_info "Pegasus features enabled"
;;
false|0|no|off)
PEGASUS_ENABLED="false"
;;
*)
log_error "Invalid value for --pegasus-enabled: '$PEGASUS_ENABLED'. Must be true or false"
exit 1
;;
esac
;;
--help|-h)
show_usage
exit 0
Expand Down Expand Up @@ -549,7 +577,8 @@ sho_install() {
--set "registry.url=${SH_REGISTRY}" \
--set "registry.username=${SP_ID}" \
--set "registry.password=${SP_SECRET}" \
--set "enableECR.enabled=false" 2>&1)
--set "enableECR.enabled=false" \
--set "pegasusEnabled=$PEGASUS_ENABLED" 2>&1)
else
install_output=$(helm upgrade --install "${CHART_NAME}" "${chart_file}" \
--namespace "$NAMESPACE" \
Expand All @@ -558,7 +587,8 @@ sho_install() {
--set "image.repository=${IMAGE_NAME}" \
--set "image.tag=v${SHO_VERSION}" \
--set-string "podAnnotations.timestamp=$timestamp" \
--set "ring=$ENV" 2>&1)
--set "ring=$ENV" \
--set "pegasusEnabled=$PEGASUS_ENABLED" 2>&1)
fi

if [[ $? -eq 0 ]]; then
Expand Down
17 changes: 17 additions & 0 deletions scripts/windows-installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ param(
[string]$operation = "install",
[ValidateSet("true", "false")]
[string]$use_acr = "false", # Temporary backward compatibility for Azure ACR
[ValidateSet("true", "false")]
[string]$pegasus_enabled = "false", # Enable Pegasus features
[switch]$UseAcr,
[Alias("h")]
[switch]$help
Expand Down Expand Up @@ -38,6 +40,7 @@ $Script:ShoVersion = $version
$Script:Env = $env
$Script:Op = $operation
$Script:UseAcr = if ($UseAcr.IsPresent) { $true } elseif ($use_acr -eq "true") { $true } else { $false }
$Script:PegasusEnabled = if ($pegasus_enabled -eq "true") { $true } else { $false }

# Derived configuration
$Script:EcrAlias = ""
Expand Down Expand Up @@ -95,6 +98,8 @@ OPTIONS:
-operation OPERATION Operation: install, uninstall, get-console-url (default: install)
-use-acr BOOLEAN Use ACR registry: true, false (default: true)
[TEMPORARY: Backward compatibility for Azure ACR]
-pegasus_enabled BOOLEAN Enable Pegasus features: true, false (default: false)
Note: Only supported in test environment
-help, -h Show this help message

OPERATIONS:
Expand Down Expand Up @@ -589,6 +594,13 @@ function Install-Sho {
"--set", "ring=$Script:Env"
)

# Validate Pegasus configuration
if ($Script:PegasusEnabled -and $Script:Env -ne "test") {
Write-LogError "Pegasus features (-pegasus_enabled true) are only supported in 'test' environment"
Write-LogInfo "Current environment: $Script:Env"
return $false
}

if ($Script:UseAcr) {
Write-LogInfo "Installing with ACR registry configuration"
$helmArgs += @(
Expand All @@ -599,6 +611,11 @@ function Install-Sho {
)
}

# Add pegasusEnabled to helm arguments
$helmArgs += @(
"--set", "pegasusEnabled=$($Script:PegasusEnabled.ToString().ToLower())"
)

$installOutput = & helm $helmArgs 2>&1

if ($LASTEXITCODE -eq 0) {
Expand Down