Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
chore: Add Bash version checks and move scripts to a subdirectory
  • Loading branch information
lloydchang committed Dec 2, 2024
commit 87f764d94b895bec4298d78f6f274c74f8763b75
8 changes: 7 additions & 1 deletion codespaces_create_and_start_containers.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#!/bin/bash

# Check Bash version (adjust version as needed)
if [[ ! $(bash --version | head -n1 | awk '{print $3}' | cut -d'.' -f1-2) =~ ^5\. ]]; then
echo "Error: Requires Bash version 5 or higher." >&2
exit 1
fi

# Purpose: In GitHub Codespaces, automates the setup of Docker containers,
# preparation of Ansible inventory, and modification of tasks for testing.
# Usage: ./codespaces_create_and_start_containers.sh
# Usage: ./scripts/codespaces_create_and_start_containers.sh

# Enable strict error handling for better script robustness
set -e # Exit immediately if a command exits with a non-zero status
Expand Down
8 changes: 7 additions & 1 deletion codespaces_start_hackingbuddygpt_against_a_container.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#!/bin/bash

# Check Bash version (adjust version as needed)
if [[ ! $(bash --version | head -n1 | awk '{print $3}' | cut -d'.' -f1-2) =~ ^5\. ]]; then
echo "Error: Requires Bash version 5 or higher." >&2
exit 1
fi

# Purpose: In GitHub Codespaces, start hackingBuddyGPT against a container
# Usage: ./codespaces_start_hackingbuddygpt_against_a_container.sh
# Usage: ./scripts/codespaces_start_hackingbuddygpt_against_a_container.sh

# Enable strict error handling for better script robustness
set -e # Exit immediately if a command exits with a non-zero status
Expand Down
15 changes: 9 additions & 6 deletions mac_create_and_start_containers.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#!/opt/homebrew/bin/bash
#!/bin/bash

# Check Bash version (adjust version as needed)
if [[ ! $(bash --version | head -n1 | awk '{print $3}' | cut -d'.' -f1-2) =~ ^5\. ]]; then
echo "Error: Requires Bash version 5 or higher." >&2
exit 1
fi

# Purpose: Automates the setup of docker containers for local testing on Mac.
# Usage: ./mac_create_and_start_containers.sh
# Usage: ./scripts/mac_create_and_start_containers.sh

# Enable strict error handling
set -e
Expand All @@ -21,9 +27,6 @@ if [ ! -f tasks.yaml ]; then
exit 1
fi

# Default value for base port
# BASE_PORT=${BASE_PORT:-49152}

# Default values for network and base port, can be overridden by environment variables
DOCKER_NETWORK_NAME=${DOCKER_NETWORK_NAME:-192_168_65_0_24}
DOCKER_NETWORK_SUBNET="192.168.65.0/24"
Expand Down Expand Up @@ -251,6 +254,6 @@ docker --debug run --restart=unless-stopped -it -d -p 8080:8080 --name gemini-op

# Step 14: Ready to run hackingBuddyGPT

echo "You can now run ./mac_start_hackingbuddygpt_against_a_container.sh"
echo "You can now run ./scripts/mac_start_hackingbuddygpt_against_a_container.sh"

exit 0
8 changes: 7 additions & 1 deletion mac_start_hackingbuddygpt_against_a_container.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
#!/bin/bash

# Check Bash version (adjust version as needed)
if [[ ! $(bash --version | head -n1 | awk '{print $3}' | cut -d'.' -f1-2) =~ ^5\. ]]; then
echo "Error: Requires Bash version 5 or higher." >&2
exit 1
fi

# Purpose: On a Mac, start hackingBuddyGPT against a container
# Usage: ./mac_start_hackingbuddygpt_against_a_container.sh
# Usage: ./scripts/mac_start_hackingbuddygpt_against_a_container.sh

# Enable strict error handling for better script robustness
set -e # Exit immediately if a command exits with a non-zero status
Expand Down
1 change: 1 addition & 0 deletions scripts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mkdir scripts