#10 Update actions and setup script
- Removed the step to run the DRB client from socket tests - Added a testing switch to the install script to return all preset values for all user input - Added test switch to client setup action step
This commit is contained in:
@@ -23,4 +23,4 @@ jobs:
|
|||||||
- name: Test setup script
|
- name: Test setup script
|
||||||
working-directory: "./client"
|
working-directory: "./client"
|
||||||
run: |
|
run: |
|
||||||
sudo bash setup.sh
|
sudo bash setup.sh --test
|
||||||
@@ -75,8 +75,4 @@ jobs:
|
|||||||
working-directory: "./client"
|
working-directory: "./client"
|
||||||
run: npm test
|
run: npm test
|
||||||
|
|
||||||
- run: echo "Completed the NPM tests"
|
- run: echo "Completed the DRB tests"
|
||||||
|
|
||||||
- name: Start discord-radio-bot service
|
|
||||||
working-directory: "./client"
|
|
||||||
run: systemctl start discord-radio-bot.service
|
|
||||||
@@ -19,20 +19,36 @@ fi
|
|||||||
####------------------- Functions
|
####------------------- Functions
|
||||||
# Function to prompt user for input with a specific message and store the result in a variable
|
# Function to prompt user for input with a specific message and store the result in a variable
|
||||||
prompt_user() {
|
prompt_user() {
|
||||||
|
if [[ "$TEST_MODE" == "true" ]]; then
|
||||||
|
echo "TESTING" # Use the pre-set value
|
||||||
|
else
|
||||||
read -p "$1: " input
|
read -p "$1: " input
|
||||||
echo "$input"
|
echo "$input"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to prompt user for capabilities options and store the result in a variable
|
# Function to prompt user for capabilities options and store the result in a variable
|
||||||
prompt_capabilities() {
|
prompt_capabilities() {
|
||||||
|
if [[ "$TEST_MODE" == "true" ]]; then
|
||||||
|
echo "radio" # Use the pre-set value
|
||||||
|
else
|
||||||
default_capabilities="radio" # Default value
|
default_capabilities="radio" # Default value
|
||||||
read -p "Select CLIENT_CAPABILITIES (comma-separated, default: $default_capabilities): " capabilities
|
read -p "Select CLIENT_CAPABILITIES (comma-separated, default: $default_capabilities): " capabilities
|
||||||
capabilities="${capabilities:-$default_capabilities}" # Use default value if input is empty
|
capabilities="${capabilities:-$default_capabilities}" # Use default value if input is empty
|
||||||
echo "$capabilities"
|
echo "$capabilities"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to prompt user for nearby systems details
|
# Function to prompt user for nearby systems details
|
||||||
prompt_nearby_system() {
|
prompt_nearby_system() {
|
||||||
|
if [[ "$TEST_MODE" == "true" ]]; then
|
||||||
|
echo "\"TESTING-Node\": {
|
||||||
|
\"frequencies\": [\"$(echo "155750000,154750000,156555550" | sed 's/,/","/g')\"],
|
||||||
|
\"mode\": \"p25\",
|
||||||
|
\"trunkFile\": \"testing_trunk.tsv\",
|
||||||
|
\"whitelistFile\": \"testing_whitelist.tsv\"
|
||||||
|
}," # Use the pre-set value
|
||||||
|
else
|
||||||
local system_name=""
|
local system_name=""
|
||||||
local frequencies=""
|
local frequencies=""
|
||||||
local mode=""
|
local mode=""
|
||||||
@@ -53,9 +69,17 @@ prompt_nearby_system() {
|
|||||||
\"mode\": \"$mode\",
|
\"mode\": \"$mode\",
|
||||||
\"trunkFile\": \"$trunk_file\",
|
\"trunkFile\": \"$trunk_file\",
|
||||||
\"whitelistFile\": \"$whitelist_file\"
|
\"whitelistFile\": \"$whitelist_file\"
|
||||||
},"
|
},"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Check if test mode is enabled
|
||||||
|
if [[ "$1" == "--test" ]]; then
|
||||||
|
TEST_MODE="true"
|
||||||
|
else
|
||||||
|
TEST_MODE="false"
|
||||||
|
fi
|
||||||
|
|
||||||
# Install Node Repo
|
# Install Node Repo
|
||||||
# Get the CPU architecture
|
# Get the CPU architecture
|
||||||
cpu_arch=$(uname -m)
|
cpu_arch=$(uname -m)
|
||||||
|
|||||||
Reference in New Issue
Block a user