dropshell release 2025.0514.2222
Some checks failed
Dropshell Test / Build_and_Test (push) Has been cancelled
Some checks failed
Dropshell Test / Build_and_Test (push) Has been cancelled
This commit is contained in:
parent
283b88effc
commit
47dcfca5f2
41
build.sh
41
build.sh
@ -9,15 +9,11 @@ GREEN='\033[0;32m'
|
||||
YELLOW='\033[1;33m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
# Parse command line arguments
|
||||
AUTO_INSTALL=false
|
||||
for arg in "$@"; do
|
||||
case $arg in
|
||||
--auto-install)
|
||||
AUTO_INSTALL=true
|
||||
;;
|
||||
esac
|
||||
done
|
||||
JOBS=4
|
||||
# Determine number of CPU cores for parallel build
|
||||
if command -v nproc >/dev/null 2>&1; then
|
||||
JOBS=$(nproc)
|
||||
fi
|
||||
|
||||
|
||||
# Function to print status messages
|
||||
@ -79,7 +75,7 @@ cmake .. -DCMAKE_BUILD_TYPE=Debug
|
||||
|
||||
# Build the project
|
||||
print_status "Building project..."
|
||||
make -j$(nproc)
|
||||
make -j"$JOBS"
|
||||
|
||||
# Check if build was successful
|
||||
if [ $? -eq 0 ]; then
|
||||
@ -90,27 +86,16 @@ else
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if user wants to install
|
||||
if [ $AUTO_INSTALL = true ]; then
|
||||
print_status "Auto-installing dropshell..."
|
||||
sudo make install
|
||||
if [ $? -eq 0 ]; then
|
||||
print_status "Installation successful!"
|
||||
else
|
||||
print_error "Installation failed!"
|
||||
exit 1
|
||||
fi
|
||||
print_status "Auto-installing dropshell..."
|
||||
sudo make install
|
||||
if [ $? -eq 0 ]; then
|
||||
print_status "Installation successful!"
|
||||
else
|
||||
print_status "Installing dropshell..."
|
||||
sudo make install
|
||||
if [ $? -eq 0 ]; then
|
||||
print_status "Installation successful!"
|
||||
else
|
||||
print_error "Installation failed!"
|
||||
exit 1
|
||||
fi
|
||||
print_error "Installation failed!"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
# Return to original directory
|
||||
cd ..
|
||||
|
||||
|
@ -72,7 +72,7 @@ if [ -z "$RELEASE_ID" ]; then
|
||||
fi
|
||||
|
||||
# Upload binaries and install.sh
|
||||
for FILE in dropshell.amd64 dropshell.arm64 install.sh; do
|
||||
for FILE in dropshell.amd64 dropshell.arm64 install.sh server_autosetup.sh; do
|
||||
if [ -f "build/$FILE" ]; then
|
||||
filetoupload="build/$FILE"
|
||||
elif [ -f "$FILE" ]; then
|
||||
|
@ -55,6 +55,13 @@ if ! command -v docker &> /dev/null; then
|
||||
rm get-docker.sh
|
||||
fi
|
||||
|
||||
# check bb64 installation
|
||||
if ! command -v bb64 &> /dev/null; then
|
||||
echo "bb64 is not installed."
|
||||
echo "Installing bb64..."
|
||||
curl -fsSL https://gitea.jde.nz/public/bb64/releases/download/latest/install.sh | bash
|
||||
fi
|
||||
|
||||
# check dropshell user exists
|
||||
if ! id "dropshell" &> /dev/null; then
|
||||
echo "Dropshell user does not exist."
|
@ -290,15 +290,43 @@ namespace dropshell
|
||||
if (rval != 0)
|
||||
return rval;
|
||||
|
||||
std::cout << "Installation complete." << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int install_server(const std::string &server)
|
||||
{
|
||||
#pragma WARNING "Need to implement install_server"
|
||||
// install the dropshell agent on the given server.
|
||||
return 1; // NOTIMPL
|
||||
std::cout << "Installing dropshell agent on " << server << std::endl;
|
||||
|
||||
std::string agent_path = remotepath::agent(server);
|
||||
if (agent_path.empty())
|
||||
{
|
||||
std::cerr << "Failed to get agent path for " << server << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// first install bb64.
|
||||
std::string remote_cmd =
|
||||
"curl -fsSL https://gitea.jde.nz/public/bb64/releases/download/latest/install.sh | bash -s -- " + agent_path;
|
||||
|
||||
server_env_manager server_env(server);
|
||||
if (!server_env.is_valid()) {
|
||||
std::cerr << "Invalid server environment for " << server << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::string fullcmd = "ssh -p " + server_env.get_SSH_INFO().port + " " + server_env.get_SSH_INFO().user + "@" + server_env.get_SSH_INFO().host;
|
||||
fullcmd += " bash -c '" + remote_cmd + "'";
|
||||
|
||||
std::cout << "Executing: " << fullcmd << std::endl;
|
||||
if (!execute_local_command(fullcmd, nullptr, cMode::Silent)) {
|
||||
std::cerr << "Failed to download bb64 to " << agent_path << " on remote server." << std::endl;
|
||||
} else {
|
||||
std::cout << "Downloaded bb64 to " << agent_path << " on remote server." << std::endl;
|
||||
}
|
||||
return 0; // NOTIMPL
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------------------------------
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include "utils/assert.hpp"
|
||||
|
||||
#pragma TODO("Fix issues with Nuke below.")
|
||||
#pragma message ("TODO: Fix issues with Nuke below.")
|
||||
|
||||
/*
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user