Skip to content

Commit 8e84a55

Browse files
authored
chore: update deploy script with help (#1461)
1 parent 7468529 commit 8e84a55

File tree

3 files changed

+32
-6
lines changed

3 files changed

+32
-6
lines changed

crates/core/src/config.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,8 @@ impl ConfigArgs {
322322
bandwidth_limit: self.network_api.bandwidth_limit,
323323
},
324324
ws_api: WebsocketApiConfig {
325-
address: self.ws_api.address.unwrap_or_else(|| match mode {
326-
OperationMode::Local => default_local_address(),
327-
OperationMode::Network => default_listening_address(),
328-
}),
325+
// the websocket API is always local
326+
address: self.ws_api.address.unwrap_or_else(default_local_address),
329327
port: self
330328
.ws_api
331329
.ws_api_port

crates/core/tests/operations.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ async fn test_put_contract() -> TestResult {
188188

189189
let test = tokio::time::timeout(Duration::from_secs(60), async {
190190
// Wait for nodes to start up
191-
tokio::time::sleep(Duration::from_secs(5)).await;
191+
tokio::time::sleep(Duration::from_secs(10)).await;
192192

193193
// Connect to node A's websocket API
194194
let uri = format!(
@@ -348,7 +348,7 @@ async fn test_update_contract() -> TestResult {
348348

349349
let test = tokio::time::timeout(Duration::from_secs(60), async {
350350
// Wait for nodes to start up
351-
tokio::time::sleep(Duration::from_secs(5)).await;
351+
tokio::time::sleep(Duration::from_secs(10)).await;
352352

353353
// Connect to node A websocket API
354354
let uri = format!(

scripts/update-remote-gws.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,36 @@
44
RED='\033[0;31m'
55
GREEN='\033[0;32m'
66
YELLOW='\033[1;33m'
7+
BLUE='\033[0;34m'
78
NC='\033[0m' # No Color
89

10+
# Help function
11+
show_help() {
12+
echo -e "${BLUE}Update Remote Gateways Script${NC}"
13+
echo -e "This script deploys binary artifacts from the cross-compile.yml GitHub Actions workflow"
14+
echo -e "to remote Freenet gateway servers.\n"
15+
echo -e "${YELLOW}Usage:${NC}"
16+
echo -e " $0 [options]\n"
17+
echo -e "${YELLOW}Options:${NC}"
18+
echo -e " -h, --help Show this help message\n"
19+
echo -e "${YELLOW}Environment Variables:${NC}"
20+
echo -e " ARTIFACTS_DIR Directory containing the binary artifacts (default: current directory)"
21+
echo -e " BINARIES_PATH Temporary path for unpacked binaries (default: $TMPDIR or /tmp)\n"
22+
echo -e "${YELLOW}Expected Artifacts:${NC}"
23+
echo -e " The script expects zip files in the format: binaries-<arch>-<binary>.zip"
24+
echo -e " These artifacts are produced by the cross-compile.yml GitHub Actions workflow"
25+
echo -e " Example: binaries-x86_64-freenet.zip, binaries-arm64-fdev.zip\n"
26+
echo -e "${YELLOW}Target Servers:${NC}"
27+
echo -e " The script deploys to servers defined in the SERVERS array with their architectures"
28+
echo -e " Each server will receive the appropriate architecture binaries"
29+
}
30+
31+
# Check for help flags
32+
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
33+
show_help
34+
exit 0
35+
fi
36+
937
# Configuration
1038
REMOTE_DIR="/usr/local/bin" # Remote directory where binaries will be copied
1139
BINARIES=("freenet" "fdev") # Binaries to copy (fixed syntax - no commas)

0 commit comments

Comments
 (0)