forked from langchain-ai/langchainjs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ci): Add script for aliasing domains in gh deployments (langchain…
- Loading branch information
1 parent
d1230ff
commit 92938a6
Showing
2 changed files
with
47 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
# Check if an argument is provided | ||
if [ $# -eq 0 ]; then | ||
echo "Error: Please provide a version string as an argument." | ||
exit 1 | ||
fi | ||
|
||
inputString=$1 | ||
|
||
# Check if VERCEL_TOKEN is set | ||
if [ -z "$VERCEL_TOKEN" ]; then | ||
echo "Error: VERCEL_TOKEN is not set." | ||
exit 1 | ||
fi | ||
|
||
# save stdout and stderr to files | ||
vercel deploy --prebuilt --token="$VERCEL_TOKEN" >deployment-url.txt 2>error.txt | ||
|
||
# check the exit code | ||
code=$? | ||
if [ $code -eq 0 ]; then | ||
# Set the deploymentUrl using the input string | ||
deploymentUrl="${inputString}.api.js.langchain.com" | ||
vercel alias $(cat deployment-url.txt) $deploymentUrl --token="$VERCEL_TOKEN" --scope="langchain" | ||
else | ||
# Handle the error | ||
errorMessage=$(cat error.txt) | ||
echo "There was an error: $errorMessage" | ||
fi |
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