-
Notifications
You must be signed in to change notification settings - Fork 549
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
2 changed files
with
128 additions
and
126 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,144 +84,150 @@ do | |
currPinnedDb=$(echo "$pinnedDBArray" | jq ".[$i]") | ||
currPinnedDb=$(echo "$currPinnedDb" | tr -d '"') | ||
|
||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "===== testing $currPinnedDb with plugin-interface $currVersion =====" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
|
||
i=$((i+1)) | ||
|
||
if [[ $currPinnedDb == "sqlite" ]] | ||
if (( i % CIRCLE_NODE_TOTAL == CIRCLE_NODE_INDEX )) | ||
then | ||
# shellcheck disable=SC2034 | ||
continue=1 | ||
else | ||
response=$(curl -s -X GET \ | ||
"https://api.supertokens.io/0/plugin-interface/dependency/plugin/latest?password=$SUPERTOKENS_API_KEY&planType=FREE&mode=DEV&version=$piVersion&pluginName=$currPinnedDb" \ | ||
-H 'api-version: 0') | ||
if [[ $(echo "$response" | jq .plugin) == "null" ]] | ||
then | ||
echo "fetching latest X.Y version for $currPinnedDb given plugin-interface X.Y version: $piVersion gave response: $response" | ||
exit 1 | ||
fi | ||
pinnedDbVersionX2=$(echo $response | jq .plugin | tr -d '"') | ||
|
||
response=$(curl -s -X GET \ | ||
"https://api.supertokens.io/0/plugin/latest?password=$SUPERTOKENS_API_KEY&planType=FREE&mode=DEV&version=$pinnedDbVersionX2&name=$currPinnedDb" \ | ||
-H 'api-version: 0') | ||
if [[ $(echo "$response" | jq .tag) == "null" ]] | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "===== testing $currPinnedDb with plugin-interface $currVersion =====" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
|
||
if [[ $currPinnedDb == "sqlite" ]] | ||
then | ||
echo "fetching latest X.Y.Z version for $currPinnedDb, X.Y version: $pinnedDbVersionX2 gave response: $response" | ||
exit 1 | ||
# shellcheck disable=SC2034 | ||
continue=1 | ||
else | ||
response=$(curl -s -X GET \ | ||
"https://api.supertokens.io/0/plugin-interface/dependency/plugin/latest?password=$SUPERTOKENS_API_KEY&planType=FREE&mode=DEV&version=$piVersion&pluginName=$currPinnedDb" \ | ||
-H 'api-version: 0') | ||
if [[ $(echo "$response" | jq .plugin) == "null" ]] | ||
then | ||
echo "fetching latest X.Y version for $currPinnedDb given plugin-interface X.Y version: $piVersion gave response: $response" | ||
exit 1 | ||
fi | ||
pinnedDbVersionX2=$(echo $response | jq .plugin | tr -d '"') | ||
|
||
response=$(curl -s -X GET \ | ||
"https://api.supertokens.io/0/plugin/latest?password=$SUPERTOKENS_API_KEY&planType=FREE&mode=DEV&version=$pinnedDbVersionX2&name=$currPinnedDb" \ | ||
-H 'api-version: 0') | ||
if [[ $(echo "$response" | jq .tag) == "null" ]] | ||
then | ||
echo "fetching latest X.Y.Z version for $currPinnedDb, X.Y version: $pinnedDbVersionX2 gave response: $response" | ||
exit 1 | ||
fi | ||
pinnedDbVersionTag=$(echo "$response" | jq .tag | tr -d '"') | ||
pinnedDbVersion=$(echo "$response" | jq .version | tr -d '"') | ||
./startDb.sh "$currPinnedDb" | ||
fi | ||
pinnedDbVersionTag=$(echo "$response" | jq .tag | tr -d '"') | ||
pinnedDbVersion=$(echo "$response" | jq .version | tr -d '"') | ||
./startDb.sh "$currPinnedDb" | ||
fi | ||
|
||
cd ../../ | ||
git clone [email protected]:supertokens/supertokens-root.git | ||
cd supertokens-root | ||
cd ../../ | ||
git clone [email protected]:supertokens/supertokens-root.git | ||
cd supertokens-root | ||
|
||
update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2 | ||
update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2 | ||
update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-15.0.1/bin/java" 2 | ||
update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-15.0.1/bin/javac" 2 | ||
|
||
coreX=$(cut -d'.' -f1 <<<"$coreVersion") | ||
coreY=$(cut -d'.' -f2 <<<"$coreVersion") | ||
if [[ $currPinnedDb == "sqlite" ]] | ||
then | ||
echo -e "core,$coreX.$coreY\nplugin-interface,$piVersion" > modules.txt | ||
else | ||
echo -e "core,$coreX.$coreY\nplugin-interface,$piVersion\n$currPinnedDb-plugin,$pinnedDbVersionX2" > modules.txt | ||
fi | ||
./loadModules | ||
cd supertokens-core | ||
git checkout dev-v$coreVersion | ||
cd ../supertokens-plugin-interface | ||
git checkout $currTag | ||
if [[ $currPinnedDb == "sqlite" ]] | ||
then | ||
# shellcheck disable=SC2034 | ||
continue=1 | ||
else | ||
cd ../supertokens-$currPinnedDb-plugin | ||
git checkout $pinnedDbVersionTag | ||
fi | ||
cd ../ | ||
echo $SUPERTOKENS_API_KEY > apiPassword | ||
./startTestingEnv --cicd | ||
|
||
if [[ $? -ne 0 ]] | ||
then | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "===== testing $currPinnedDb with plugin-interface $currVersion FAILED =====" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
|
||
cat logs/* | ||
cd ../project/ | ||
echo "test failed... exiting!" | ||
exit 1 | ||
fi | ||
coreX=$(cut -d'.' -f1 <<<"$coreVersion") | ||
coreY=$(cut -d'.' -f2 <<<"$coreVersion") | ||
if [[ $currPinnedDb == "sqlite" ]] | ||
then | ||
echo -e "core,$coreX.$coreY\nplugin-interface,$piVersion" > modules.txt | ||
else | ||
echo -e "core,$coreX.$coreY\nplugin-interface,$piVersion\n$currPinnedDb-plugin,$pinnedDbVersionX2" > modules.txt | ||
fi | ||
./loadModules | ||
cd supertokens-core | ||
git checkout dev-v$coreVersion | ||
cd ../supertokens-plugin-interface | ||
git checkout $currTag | ||
if [[ $currPinnedDb == "sqlite" ]] | ||
then | ||
# shellcheck disable=SC2034 | ||
continue=1 | ||
else | ||
cd ../supertokens-$currPinnedDb-plugin | ||
git checkout $pinnedDbVersionTag | ||
fi | ||
cd ../ | ||
echo $SUPERTOKENS_API_KEY > apiPassword | ||
./startTestingEnv --cicd | ||
|
||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "===== testing $currPinnedDb with plugin-interface $currVersion SUCCEEDED =====" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
|
||
cd ../ | ||
rm -rf supertokens-root | ||
|
||
if [[ $currPinnedDb == "sqlite" ]] | ||
then | ||
# shellcheck disable=SC2034 | ||
continue=1 | ||
else | ||
curl -o supertokens.zip -s -X GET \ | ||
"https://api.supertokens.io/0/app/download?pluginName=$currPinnedDb&os=linux&mode=DEV&binary=FREE&targetCore=$coreVersion&targetPlugin=$pinnedDbVersion" \ | ||
-H 'api-version: 0' | ||
unzip supertokens.zip -d . | ||
rm supertokens.zip | ||
cd supertokens | ||
../project/.circleci/testCli.sh | ||
if [[ $? -ne 0 ]] | ||
then | ||
echo "cli testing failed... exiting!" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "===== testing $currPinnedDb with plugin-interface $currVersion FAILED =====" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
|
||
cat logs/* | ||
cd ../project/ | ||
echo "test failed... exiting!" | ||
exit 1 | ||
fi | ||
|
||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "===== testing $currPinnedDb with plugin-interface $currVersion SUCCEEDED =====" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
echo "" | ||
|
||
cd ../ | ||
fi | ||
rm -rf supertokens-root | ||
|
||
if [[ $currPinnedDb == "sqlite" ]] | ||
then | ||
# shellcheck disable=SC2034 | ||
continue=1 | ||
else | ||
curl -o supertokens.zip -s -X GET \ | ||
"https://api.supertokens.io/0/app/download?pluginName=$currPinnedDb&os=linux&mode=DEV&binary=FREE&targetCore=$coreVersion&targetPlugin=$pinnedDbVersion" \ | ||
-H 'api-version: 0' | ||
unzip supertokens.zip -d . | ||
rm supertokens.zip | ||
cd supertokens | ||
../project/.circleci/testCli.sh | ||
if [[ $? -ne 0 ]] | ||
then | ||
echo "cli testing failed... exiting!" | ||
exit 1 | ||
fi | ||
cd ../ | ||
fi | ||
|
||
rm -rf supertokens | ||
cd project/.circleci | ||
if [[ $currPinnedDb == "sqlite" ]] | ||
then | ||
# shellcheck disable=SC2034 | ||
continue=1 | ||
else | ||
./stopDb.sh $currPinnedDb | ||
fi | ||
|
||
rm -rf supertokens | ||
cd project/.circleci | ||
if [[ $currPinnedDb == "sqlite" ]] | ||
then | ||
# shellcheck disable=SC2034 | ||
continue=1 | ||
else | ||
./stopDb.sh $currPinnedDb | ||
fi | ||
|
||
done | ||
done 10<pluginInterfaceExactVersionsOutput | ||
|
||
|