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
35
build.sh
35
build.sh
@ -9,15 +9,11 @@ GREEN='\033[0;32m'
|
|||||||
YELLOW='\033[1;33m'
|
YELLOW='\033[1;33m'
|
||||||
NC='\033[0m' # No Color
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
# Parse command line arguments
|
JOBS=4
|
||||||
AUTO_INSTALL=false
|
# Determine number of CPU cores for parallel build
|
||||||
for arg in "$@"; do
|
if command -v nproc >/dev/null 2>&1; then
|
||||||
case $arg in
|
JOBS=$(nproc)
|
||||||
--auto-install)
|
fi
|
||||||
AUTO_INSTALL=true
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
# Function to print status messages
|
# Function to print status messages
|
||||||
@ -79,7 +75,7 @@ cmake .. -DCMAKE_BUILD_TYPE=Debug
|
|||||||
|
|
||||||
# Build the project
|
# Build the project
|
||||||
print_status "Building project..."
|
print_status "Building project..."
|
||||||
make -j$(nproc)
|
make -j"$JOBS"
|
||||||
|
|
||||||
# Check if build was successful
|
# Check if build was successful
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
@ -90,27 +86,16 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if user wants to install
|
print_status "Auto-installing dropshell..."
|
||||||
if [ $AUTO_INSTALL = true ]; then
|
sudo make install
|
||||||
print_status "Auto-installing dropshell..."
|
if [ $? -eq 0 ]; then
|
||||||
sudo make install
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
print_status "Installation successful!"
|
print_status "Installation successful!"
|
||||||
else
|
|
||||||
print_error "Installation failed!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
print_status "Installing dropshell..."
|
|
||||||
sudo make install
|
|
||||||
if [ $? -eq 0 ]; then
|
|
||||||
print_status "Installation successful!"
|
|
||||||
else
|
|
||||||
print_error "Installation failed!"
|
print_error "Installation failed!"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Return to original directory
|
# Return to original directory
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ if [ -z "$RELEASE_ID" ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Upload binaries and install.sh
|
# 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
|
if [ -f "build/$FILE" ]; then
|
||||||
filetoupload="build/$FILE"
|
filetoupload="build/$FILE"
|
||||||
elif [ -f "$FILE" ]; then
|
elif [ -f "$FILE" ]; then
|
||||||
|
@ -55,6 +55,13 @@ if ! command -v docker &> /dev/null; then
|
|||||||
rm get-docker.sh
|
rm get-docker.sh
|
||||||
fi
|
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
|
# check dropshell user exists
|
||||||
if ! id "dropshell" &> /dev/null; then
|
if ! id "dropshell" &> /dev/null; then
|
||||||
echo "Dropshell user does not exist."
|
echo "Dropshell user does not exist."
|
@ -290,15 +290,43 @@ namespace dropshell
|
|||||||
if (rval != 0)
|
if (rval != 0)
|
||||||
return rval;
|
return rval;
|
||||||
|
|
||||||
|
std::cout << "Installation complete." << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int install_server(const std::string &server)
|
int install_server(const std::string &server)
|
||||||
{
|
{
|
||||||
#pragma WARNING "Need to implement install_server"
|
|
||||||
// install the dropshell agent on the given 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"
|
#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