diff --git a/.circleci/config.yml b/.circleci/config.yml index 7e51cbac9..0b5542fd8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -21,9 +21,15 @@ jobs: - run: echo "listen_addresses='*'" >> /etc/postgresql/9.5/main/postgresql.conf - run: sed -i 's/^#*\s*max_connections\s*=.*/max_connections = 10000/' /etc/postgresql/9.5/main/postgresql.conf - run: (cd .circleci/ && ./doTests.sh << parameters.plugin >>) - - slack/status: - success_message: ':tada: A $CIRCLE_JOB job for << parameters.plugin >> plugin has succeeded!' - failure_message: ':red_circle: A $CIRCLE_JOB job for << parameters.plugin >> plugin has failed!' + - slack/status + + mark-passed: + docker: + - image: rishabhpoddar/supertokens_core_testing + steps: + - checkout + - run: (cd .circleci && ./markPassed.sh) + - slack/status workflows: version: 2 @@ -69,3 +75,16 @@ workflows: only: /dev-v[0-9]+(\.[0-9]+)*/ branches: ignore: /.*/ + - mark-passed: + context: + - slack-notification + filters: + tags: + only: /dev-v[0-9]+(\.[0-9]+)*/ + branches: + ignore: /.*/ + requires: + - test-sqlite + - test-mongodb + - test-postgresql + - test-mysql diff --git a/.circleci/doTests.sh b/.circleci/doTests.sh index 75165dad1..85bc80662 100755 --- a/.circleci/doTests.sh +++ b/.circleci/doTests.sh @@ -235,23 +235,8 @@ done 10<pluginInterfaceExactVersionsOutput if [[ $someTestsRan = "true" ]] then - echo "calling /core PATCH to make testing passed" - responseStatus=$(curl -s -o /dev/null -w "%{http_code}" -X PATCH \ - https://api.supertokens.io/0/core \ - -H 'Content-Type: application/json' \ - -H 'api-version: 0' \ - -d "{ - \"password\": \"$SUPERTOKENS_API_KEY\", - \"planType\":\"FREE\", - \"version\":\"$coreVersion\", - \"testPassed\": true - }") - if [ "$responseStatus" -ne "200" ] - then - echo "patch api failed" - exit 1 - fi + echo "tests ran successfully" else echo "no test ran" exit 1 -fi \ No newline at end of file +fi diff --git a/.circleci/markPassed.sh b/.circleci/markPassed.sh new file mode 100755 index 000000000..297531c13 --- /dev/null +++ b/.circleci/markPassed.sh @@ -0,0 +1,29 @@ +coreVersion=$(cat ../build.gradle | grep -e "version =" -e "version=") + +while IFS='"' read -ra ADDR; do + counter=0 + for i in "${ADDR[@]}"; do + if [ $counter == 1 ] + then + coreVersion=$i + fi + counter=$(($counter+1)) + done +done <<< "$coreVersion" + +echo "calling /core PATCH to make testing passed" +responseStatus=$(curl -s -o /dev/null -w "%{http_code}" -X PATCH \ + https://api.supertokens.io/0/core \ + -H 'Content-Type: application/json' \ + -H 'api-version: 0' \ + -d "{ + \"password\": \"$SUPERTOKENS_API_KEY\", + \"planType\":\"FREE\", + \"version\":\"$coreVersion\", + \"testPassed\": true + }") +if [ "$responseStatus" -ne "200" ] +then + echo "patch api failed" + exit 1 +fi