chore: use Famedly runners

Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
This commit is contained in:
TheOneWithTheBraid 2022-11-28 07:12:40 +01:00
commit 78bfe2dec7
13 changed files with 118 additions and 77 deletions

View file

@ -1,8 +1,35 @@
#!/usr/bin/env bash
IP_ADDRESS="$(drill docker | grep -m 1 -P "\d+\.\d+\.\d+.\d+" | awk -F ' ' '{print $NF}')"
sed -i "s/10.0.2.2/$IP_ADDRESS/g" integration_test/users.dart
if [ -z $HOMESERVER ]; then
echo "Please ensure HOMESERVER environment variable is set to the IP or hostname of the homeserver."
exit 1
fi
if [ -z $USER1_NAME ]; then
echo "Please ensure USER1_NAME environment variable is set to first user name."
exit 1
fi
if [ -z $USER1_PW ]; then
echo "Please ensure USER1_PW environment variable is set to first user password."
exit 1
fi
if [ -z $USER2_NAME ]; then
echo "Please ensure USER2_NAME environment variable is set to second user name."
exit 1
fi
if [ -z $USER2_PW ]; then
echo "Please ensure USER2_PW environment variable is set to second user password."
exit 1
fi
curl -XPOST -d '{"username":"alice", "password":"AliceInWonderland", "inhibit_login":true, "auth": {"type":"m.login.dummy"}}' "http://$IP_ADDRESS:8008/_matrix/client/r0/register"
curl -XPOST -d '{"username":"bob", "password":"JoWirSchaffenDas", "inhibit_login":true, "auth": {"type":"m.login.dummy"}}' "http://$IP_ADDRESS:8008/_matrix/client/r0/register"
curl -XPOST -d '{"username":"trudy", "password":"HaveIBeenPwned", "inhibit_login":true, "auth": {"type":"m.login.dummy"}}' "http://$IP_ADDRESS:8008/_matrix/client/r0/register"
echo "Waiting for homeserver to be available... (GET http://$HOMESERVER/_matrix/client/v3/login)"
while ! curl -XGET "http://$HOMESERVER/_matrix/client/v3/login" >/dev/null 2>/dev/null; do
sleep 2
done
echo "Homeserver is up."
# create users
curl -fS --retry 3 -XPOST -d "{\"username\":\"$USER1_NAME\", \"password\":\"$USER1_PW\", \"inhibit_login\":true, \"auth\": {\"type\":\"m.login.dummy\"}}" "http://$HOMESERVER/_matrix/client/r0/register"
curl -fS --retry 3 -XPOST -d "{\"username\":\"$USER2_NAME\", \"password\":\"$USER2_PW\", \"inhibit_login\":true, \"auth\": {\"type\":\"m.login.dummy\"}}" "http://$HOMESERVER/_matrix/client/r0/register"