Getting closer
soaricarus_api CI / Rustfmt (pull_request) Failing after 14m32s
soaricarus_api CI / Test Suite (pull_request) Failing after 14m33s
soaricarus_api CI / Check (pull_request) Failing after 14m34s
soaricarus_api CI / Clippy (pull_request) Successful in 3m11s
soaricarus_api CI / build (pull_request) Successful in 3m46s
soaricarus_api CI / Rustfmt (pull_request) Failing after 14m32s
soaricarus_api CI / Test Suite (pull_request) Failing after 14m33s
soaricarus_api CI / Check (pull_request) Failing after 14m34s
soaricarus_api CI / Clippy (pull_request) Successful in 3m11s
soaricarus_api CI / build (pull_request) Successful in 3m46s
This commit is contained in:
+35
-12
@@ -21,14 +21,23 @@ EOF
|
||||
echo "✅ Credentials saved to $CREDENTIALS_FILE"
|
||||
}
|
||||
|
||||
sleep 20
|
||||
echo "Garage secret"
|
||||
echo "$GARAGE_RPC_SECRET"
|
||||
echo "Should be printed"
|
||||
sleep 20
|
||||
|
||||
echo "Sleeping for a bit"
|
||||
sleep 5
|
||||
echo "Starting garage"
|
||||
GARAGE_COMMAND_EXEC="$GARAGE_BIN -c /etc/garage.toml server"
|
||||
|
||||
# Check if setup already completed
|
||||
if [ -f "$SETUP_DONE" ]; then
|
||||
echo "ℹ️ Setup already completed. Starting Garage..."
|
||||
sleep 5
|
||||
exec $GARAGE_COMMANDS_EXEC
|
||||
exit
|
||||
fi
|
||||
|
||||
echo "🔧 First-time setup - initializing Garage..."
|
||||
@@ -44,11 +53,21 @@ $GARAGE_COMMAND_EXEC & GARAGE_PID=$!
|
||||
echo "GARAGE_PID: $GARAGE_PID"
|
||||
|
||||
# echo "Command: $GARAGE_BIN $@"
|
||||
sleep 20
|
||||
echo "Garage secret"
|
||||
echo "$GARAGE_RPC_SECRET"
|
||||
echo "Should be printed"
|
||||
sleep 20
|
||||
|
||||
# Apply cluster layout
|
||||
if ! $GARAGE_BIN layout show 2>/dev/null | grep -q "Current cluster layout"; then
|
||||
echo "📦 Applying cluster layout..."
|
||||
NODE_ID=$($GARAGE_BIN node id | head -n1)
|
||||
if [ -z "$NODE_ID" ]; then
|
||||
echo "$NODE_ID is empty"
|
||||
sleep 5
|
||||
exit
|
||||
fi
|
||||
echo "Node ID: $NODE_ID"
|
||||
sleep 5
|
||||
|
||||
@@ -56,13 +75,14 @@ if ! $GARAGE_BIN layout show 2>/dev/null | grep -q "Current cluster layout"; the
|
||||
# $GARAGE_BIN layout assign --version 1 -z ny1 -c 4G $NODE_ID
|
||||
$GARAGE_BIN layout assign -z ny1 -c 4G $NODE_ID
|
||||
# $GARAGE_BIN status
|
||||
sleep 5
|
||||
# sleep 5
|
||||
# $GARAGE_BIN status
|
||||
echo "Show layout"
|
||||
$GARAGE_BIN layout show
|
||||
sleep 5
|
||||
# echo "Show layout"
|
||||
# $GARAGE_BIN layout show
|
||||
sleep 10
|
||||
echo "Applying layout"
|
||||
$GARAGE_BIN layout apply --version 1
|
||||
# $GARAGE_BIN layout apply
|
||||
echo " ✅ Layout applied"
|
||||
sleep 10
|
||||
else
|
||||
@@ -101,29 +121,32 @@ fi
|
||||
# echo " ✅ Key generated: $ACCESS_KEY"
|
||||
#fi
|
||||
|
||||
sleep 15
|
||||
echo "🔑 Generating new key..."
|
||||
KEY_OUTPUT=$($GARAGE_BIN key create --name "app-key")
|
||||
KEY_OUTPUT=$($GARAGE_BIN key create "app-key")
|
||||
echo "$KEY_OUTPUT"
|
||||
ACCESS_KEY=$(echo "$KEY_OUTPUT" | grep 'Key ID:' | awk '{print $3}')
|
||||
SECRET_KEY=$(echo "$KEY_OUTPUT" | grep 'Secret key:' | awk '{print $3}')
|
||||
echo " ✅ Key generated: $ACCESS_KEY"
|
||||
sleep 5
|
||||
|
||||
# Wait for Garage to be ready
|
||||
echo "⏳ Waiting for Garage API..."
|
||||
until curl -s -f "http://localhost:3900/v0/status" > /dev/null 2>&1; do
|
||||
echo " Not ready yet, sleeping 2s..."
|
||||
sleep 2
|
||||
done
|
||||
echo "✅ Garage API is responding!"
|
||||
# echo "⏳ Waiting for Garage API..."
|
||||
# until curl -s -f "http://localhost:3900/v0/status" > /dev/null 2>&1; do
|
||||
# echo " Not ready yet, sleeping 2s..."
|
||||
# sleep 2
|
||||
# done
|
||||
# echo "✅ Garage API is responding!"
|
||||
|
||||
# Grant permissions
|
||||
$GARAGE_BIN bucket allow --read --write --owner "$BUCKET_NAME" --key "$ACCESS_KEY"
|
||||
echo " ✅ Permissions granted"
|
||||
sleep 10
|
||||
|
||||
# Save credentials
|
||||
write_credentials "$ACCESS_KEY" "$SECRET_KEY"
|
||||
|
||||
sleep 10
|
||||
|
||||
echo "🎉 Setup complete!"
|
||||
echo " Bucket: $BUCKET_NAME"
|
||||
echo " Access Key: $ACCESS_KEY"
|
||||
|
||||
Reference in New Issue
Block a user