Skip to content

Commit a5c28b6

Browse files
marc0derclaude
andcommitted
Add CI mode to beta installation template
Co-Authored-By: Claude <[email protected]>
1 parent 0c60614 commit a5c28b6

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

app/views/install_beta.scala.txt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,35 @@ echo "$SDKMAN_PLATFORM" > "$sdkman_platform_file"
6868

6969
echo "Prime the config file..."
7070
touch "$sdkman_config_file"
71+
72+
@if(ci) {
73+
# CI mode - optimized for automated environments
74+
echo "sdkman_auto_answer=true" >> "$sdkman_config_file"
75+
echo "sdkman_colour_enable=false" >> "$sdkman_config_file"
76+
echo "sdkman_selfupdate_feature=false" >> "$sdkman_config_file"
77+
} else {
78+
# Interactive mode - optimized for human use
7179
echo "sdkman_auto_answer=false" >> "$sdkman_config_file"
80+
echo "sdkman_colour_enable=true" >> "$sdkman_config_file"
81+
echo "sdkman_selfupdate_feature=true" >> "$sdkman_config_file"
82+
}
83+
84+
# Set shell-specific config
7285
if [ -z "$ZSH_VERSION" -a -z "$BASH_VERSION" ]; then
7386
echo "sdkman_auto_complete=false" >> "$sdkman_config_file"
7487
else
7588
echo "sdkman_auto_complete=true" >> "$sdkman_config_file"
7689
fi
90+
91+
# Common settings that don't change based on CI mode
7792
echo "sdkman_auto_env=false" >> "$sdkman_config_file"
7893
echo "sdkman_beta_channel=@beta" >> "$sdkman_config_file"
7994
echo "sdkman_checksum_enable=true" >> "$sdkman_config_file"
80-
echo "sdkman_colour_enable=true" >> "$sdkman_config_file"
8195
echo "sdkman_curl_connect_timeout=7" >> "$sdkman_config_file"
8296
echo "sdkman_curl_max_time=10" >> "$sdkman_config_file"
8397
echo "sdkman_debug_mode=false" >> "$sdkman_config_file"
8498
echo "sdkman_insecure_ssl=false" >> "$sdkman_config_file"
8599
echo "sdkman_native_enable=true" >> "$sdkman_config_file"
86-
echo "sdkman_selfupdate_feature=true" >> "$sdkman_config_file"
87100

88101
# script cli distribution
89102
echo "Installing script cli archive..."

features/installation.feature

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,16 @@ Feature: Installation
5555
And a "text/plain; charset=UTF-8" content type is received
5656
And the response script contains "# install:- channel: beta"
5757
And the response script contains "Attempt update of interactive bash profile "
58-
And the response script contains "Attempt update of zsh profile...""
58+
And the response script contains "Attempt update of zsh profile..."
59+
60+
Scenario: Install SDKMAN beta in CI mode
61+
When a request is made to the /install/beta?ci=true endpoint
62+
Then a 200 status code is received
63+
And a "text/plain; charset=UTF-8" content type is received
64+
And the response script contains "# install:- channel: beta"
65+
And the response script contains "sdkman_auto_answer=true"
66+
And the response script contains "sdkman_colour_enable=false"
67+
And the response script contains "sdkman_selfupdate_feature=false"
68+
And the response script does not contain "sdkman_auto_answer=false"
69+
And the response script does not contain "sdkman_colour_enable=true"
70+
And the response script does not contain "sdkman_selfupdate_feature=true"

0 commit comments

Comments
 (0)