add default user and password in env

This commit is contained in:
lalitdeore12@gmail.com
2025-02-26 18:28:04 +05:30
parent 8ce3e3c11f
commit dbc08a5958
2 changed files with 22 additions and 60 deletions
+3 -3
View File
@@ -19,9 +19,9 @@ SHUFFLE_DOWNLOAD_AUTH_BRANCH=
SHUFFLE_APP_FORCE_UPDATE=false
# User config for first load. Username & PW: min length 3
SHUFFLE_DEFAULT_USERNAME=
SHUFFLE_DEFAULT_PASSWORD=
SHUFFLE_DEFAULT_APIKEY=
SHUFFLE_DEFAULT_USERNAME="demo@demo.io"
SHUFFLE_DEFAULT_PASSWORD="supercoolpassword"
SHUFFLE_DEFAULT_APIKEY="supercoolapikey"
# Local location of your app directory. Can't use ~/
# Files will get better at some point. Right now: local saving.
+19 -57
View File
@@ -62,49 +62,11 @@ jobs:
exit 1
fi
- name: Register a user and check the status code
run: |
MAX_RETRIES=30
RETRY_INTERVAL=10
CONTAINER_NAME="shuffle-backend"
for (( i=1; i<=$MAX_RETRIES; i++ ))
do
STATUS_CODE=$(curl -s -o /dev/null -w "%{http_code}" 'http://localhost:3001/api/v1/register' \
-H 'Accept: */*' \
-H 'Accept-Language: en-US,en;q=0.9' \
-H 'Connection: keep-alive' \
-H 'Content-Type: application/json' \
--data-raw '{"username":"demo@demo.io","password":"supercoolpassword"}')
if [ "$STATUS_CODE" -eq 200 ]; then
echo "User registration was successful with status code 200."
exit 0
elif [ "$STATUS_CODE" -ne 502 ]; then
echo "User registration failed with status code $STATUS_CODE."
exit 1
fi
echo "Received status code $STATUS_CODE. Retrying in $RETRY_INTERVAL seconds... ($i/$MAX_RETRIES)"
echo "Fetching last 30 lines of logs from container $CONTAINER_NAME..."
logs_output=$(docker logs --tail 30 "$CONTAINER_NAME")
echo "$logs_output"
echo "Fetching last 30 lines of logs from container shuffle-opensearch..."
opensearch_logs=$(docker logs --tail 30 shuffle-opensearch)
echo "$opensearch_logs"
sleep $RETRY_INTERVAL
done
echo "User registration failed after $MAX_RETRIES attempts."
exit 1
- name: Run Selenium testing for frontend
run: |
cd $GITHUB_WORKSPACE/frontend
# write some log to see the current directory
echo "I am running selenium testing script"
chmod +x frontend-testing.sh
./frontend-testing.sh
@@ -151,21 +113,21 @@ jobs:
echo "Health endpoint check failed. Response did not meet expected criteria."
exit 1
fi
notify:
needs: build
if: failure()
runs-on: ubuntu-latest
steps:
- name: Send Twilio Alert
run: |
WORKFLOW_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
MESSAGE="🚨 Shuffle Workflow Failed!
Repository: ${{ github.repository }}
Branch: ${{ github.ref_name }}
Workflow URL: $WORKFLOW_URL"
# notify:
# needs: build
# if: failure()
# runs-on: ubuntu-latest
# steps:
# - name: Send Twilio Alert
# run: |
# WORKFLOW_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
# MESSAGE="🚨 Shuffle Workflow Failed!
# Repository: ${{ github.repository }}
# Branch: ${{ github.ref_name }}
# Workflow URL: $WORKFLOW_URL"
curl -s -X POST https://api.twilio.com/2010-04-01/Accounts/${{ secrets.TWILIO_ACCOUNT_SID }}/Messages.json \
--data-urlencode "To=${{ secrets.TWILIO_TO_NUMBER }}" \
--data-urlencode "From=${{ secrets.TWILIO_FROM_NUMBER }}" \
--data-urlencode "Body=$MESSAGE" \
-u "${{ secrets.TWILIO_ACCOUNT_SID }}:${{ secrets.TWILIO_AUTH_TOKEN }}" > /dev/null
# curl -s -X POST https://api.twilio.com/2010-04-01/Accounts/${{ secrets.TWILIO_ACCOUNT_SID }}/Messages.json \
# --data-urlencode "To=${{ secrets.TWILIO_TO_NUMBER }}" \
# --data-urlencode "From=${{ secrets.TWILIO_FROM_NUMBER }}" \
# --data-urlencode "Body=$MESSAGE" \
# -u "${{ secrets.TWILIO_ACCOUNT_SID }}:${{ secrets.TWILIO_AUTH_TOKEN }}" > /dev/null