-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-test-abcdesktop.sh
More file actions
executable file
·39 lines (28 loc) · 1.1 KB
/
install-test-abcdesktop.sh
File metadata and controls
executable file
·39 lines (28 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/bash
VERSION=4.1
ABCDESKTOP_YAML_SOURCE="https://raw.githubusercontent.com/abcdesktopio/conf/main/kubernetes/abcdesktop-$VERSION.yaml"
#downloading abcdesktop.yaml file
curl --progress-bar "$ABCDESKTOP_YAML_SOURCE" --output abcdesktop.yaml
#replacing console base image by the test image
sed -i'' -e "s|image: ghcr.io/abcdesktopio/console:$VERSION|image: ghcr.io/abcdesktopio/console:test.$1|g" abcdesktop.yaml
#create a temporary file to store the output
temp_file=$(mktemp)
echo "installing abcdesktop"
#install deploy abcdesktop locally on the container
curl -sL https://raw.githubusercontent.com/abcdesktopio/conf/main/kubernetes/install-$VERSION.sh | bash > "$temp_file" 2>&1
#print abcdesktop install output
cat "$temp_file"
if [ $? -ne 0 ]; then
echo "abcdesktop install script failed to execute."
exit 1
fi
#extract the abcdesktop URL
url=$(grep -oP 'http://[0-9.]+:[0-9]+/' "$temp_file" | tail -n 1)
#clean up the temporary file
rm "$temp_file"
#check if the URL was successfully extracted
if [ -z "$url" ]; then
echo "Failed to retrieve the abcdesktop URL"
exit 1
fi
echo "$url"