-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
452 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
#!/bin/bash | ||
|
||
# Define the local .pocketbase directory | ||
POCKETBASE_DIR="$(pwd)/.pocketbase" | ||
|
||
# Remove the existing .pocketbase directory if it exists | ||
rm -rf "$POCKETBASE_DIR" | ||
|
||
# Create the .pocketbase directory if it doesn't exist | ||
mkdir -p "$POCKETBASE_DIR" | ||
|
||
# Change to the .pocketbase directory | ||
cd "$POCKETBASE_DIR" | ||
|
||
# Get the latest release tag from PocketBase GitHub releases | ||
latest_release=$(curl -s https://api.github.com/repos/pocketbase/pocketbase/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")') | ||
|
||
# Determine the architecture | ||
arch=$(uname -m) | ||
if [ "$arch" == "x86_64" ]; then | ||
arch="amd64" | ||
elif [ "$arch" == "aarch64" ]; then | ||
arch="arm64" | ||
else | ||
echo "Unsupported architecture: $arch" | ||
exit 1 | ||
fi | ||
|
||
# Construct the download URL | ||
download_url="https://github.com/pocketbase/pocketbase/releases/download/${latest_release}/pocketbase_${latest_release#v}_linux_${arch}.zip" | ||
|
||
# Download the latest release | ||
echo "Downloading PocketBase ${latest_release}..." | ||
curl -s -L -o pocketbase.zip $download_url | ||
|
||
# Check if the download was successful | ||
if [ $? -ne 0 ]; then | ||
echo "Failed to download PocketBase release." | ||
exit 1 | ||
fi | ||
|
||
# Extract the executable from the zip file | ||
echo "Extracting PocketBase ${latest_release}..." | ||
unzip -qq pocketbase.zip | ||
if [ $? -ne 0 ]; then | ||
echo "Failed to unzip PocketBase release." | ||
exit 1 | ||
fi | ||
|
||
# Make the executable file executable | ||
chmod +x pocketbase | ||
|
||
# Clean up | ||
rm pocketbase.zip | ||
|
||
# Setup admin user | ||
echo "Setting up admin user..." | ||
./pocketbase superuser upsert [email protected] test1234 | ||
if [ $? -ne 0 ]; then | ||
echo "Failed to setup admin user." | ||
exit 1 | ||
fi | ||
|
||
echo "PocketBase ${latest_release} has been downloaded and is ready to use." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export async function checkE2eConnection(): Promise<void> { | ||
try { | ||
await fetch("http://localhost:8090/api/health"); | ||
} catch { | ||
throw new Error( | ||
"E2E connection failed. Make sure the PocketBase instance is running on http://localhost:8090." | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,12 @@ export function createLoaderOptions( | |
options?: Partial<PocketBaseLoaderOptions> | ||
): PocketBaseLoaderOptions { | ||
return { | ||
url: "https://example.com", | ||
url: "http://127.0.0.1:8090", | ||
collectionName: "test", | ||
superuserCredentials: { | ||
email: "[email protected]", | ||
password: "test1234" | ||
}, | ||
...options | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.