add default user and password in env
This commit is contained in:
@@ -19,9 +19,9 @@ SHUFFLE_DOWNLOAD_AUTH_BRANCH=
|
|||||||
SHUFFLE_APP_FORCE_UPDATE=false
|
SHUFFLE_APP_FORCE_UPDATE=false
|
||||||
|
|
||||||
# User config for first load. Username & PW: min length 3
|
# User config for first load. Username & PW: min length 3
|
||||||
SHUFFLE_DEFAULT_USERNAME=
|
SHUFFLE_DEFAULT_USERNAME="demo@demo.io"
|
||||||
SHUFFLE_DEFAULT_PASSWORD=
|
SHUFFLE_DEFAULT_PASSWORD="supercoolpassword"
|
||||||
SHUFFLE_DEFAULT_APIKEY=
|
SHUFFLE_DEFAULT_APIKEY="supercoolapikey"
|
||||||
|
|
||||||
# Local location of your app directory. Can't use ~/
|
# Local location of your app directory. Can't use ~/
|
||||||
# Files will get better at some point. Right now: local saving.
|
# Files will get better at some point. Right now: local saving.
|
||||||
|
|||||||
@@ -62,49 +62,11 @@ jobs:
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
- name: Run Selenium testing for frontend
|
||||||
run: |
|
run: |
|
||||||
cd $GITHUB_WORKSPACE/frontend
|
cd $GITHUB_WORKSPACE/frontend
|
||||||
|
# write some log to see the current directory
|
||||||
|
echo "I am running selenium testing script"
|
||||||
chmod +x frontend-testing.sh
|
chmod +x frontend-testing.sh
|
||||||
./frontend-testing.sh
|
./frontend-testing.sh
|
||||||
|
|
||||||
@@ -151,21 +113,21 @@ jobs:
|
|||||||
echo "Health endpoint check failed. Response did not meet expected criteria."
|
echo "Health endpoint check failed. Response did not meet expected criteria."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
notify:
|
# notify:
|
||||||
needs: build
|
# needs: build
|
||||||
if: failure()
|
# if: failure()
|
||||||
runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
steps:
|
# steps:
|
||||||
- name: Send Twilio Alert
|
# - name: Send Twilio Alert
|
||||||
run: |
|
# run: |
|
||||||
WORKFLOW_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
# WORKFLOW_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
||||||
MESSAGE="🚨 Shuffle Workflow Failed!
|
# MESSAGE="🚨 Shuffle Workflow Failed!
|
||||||
Repository: ${{ github.repository }}
|
# Repository: ${{ github.repository }}
|
||||||
Branch: ${{ github.ref_name }}
|
# Branch: ${{ github.ref_name }}
|
||||||
Workflow URL: $WORKFLOW_URL"
|
# Workflow URL: $WORKFLOW_URL"
|
||||||
|
|
||||||
curl -s -X POST https://api.twilio.com/2010-04-01/Accounts/${{ secrets.TWILIO_ACCOUNT_SID }}/Messages.json \
|
# 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 "To=${{ secrets.TWILIO_TO_NUMBER }}" \
|
||||||
--data-urlencode "From=${{ secrets.TWILIO_FROM_NUMBER }}" \
|
# --data-urlencode "From=${{ secrets.TWILIO_FROM_NUMBER }}" \
|
||||||
--data-urlencode "Body=$MESSAGE" \
|
# --data-urlencode "Body=$MESSAGE" \
|
||||||
-u "${{ secrets.TWILIO_ACCOUNT_SID }}:${{ secrets.TWILIO_AUTH_TOKEN }}" > /dev/null
|
# -u "${{ secrets.TWILIO_ACCOUNT_SID }}:${{ secrets.TWILIO_AUTH_TOKEN }}" > /dev/null
|
||||||
|
|||||||
Reference in New Issue
Block a user