Rebrand various CI scripts and modules

This replaces Riot with Element in various CI scripts, modules, parameters, etc.
This _should_ be the last major rebranding pass (hopefully).

Fixes https://github.com/vector-im/element-web/issues/14894
This commit is contained in:
J. Ryan Stinnett
2020-12-03 13:56:27 +00:00
parent 675a4b0816
commit 1fda735222
22 changed files with 78 additions and 79 deletions
+2
View File
@@ -0,0 +1,2 @@
element-web
element.pid
@@ -0,0 +1,30 @@
{
"default_hs_url": "http://localhost:5005",
"default_is_url": "https://vector.im",
"disable_custom_urls": false,
"disable_guests": false,
"disable_login_language_selector": false,
"disable_3pid_login": false,
"brand": "Element",
"integrations_ui_url": "https://scalar.vector.im/",
"integrations_rest_url": "https://scalar.vector.im/api",
"bug_report_endpoint_url": "https://element.io/bugreports/submit",
"showLabsSettings": true,
"default_federate": true,
"welcomePageUrl": "home.html",
"default_theme": "light",
"roomDirectory": {
"servers": [
"localhost:5005"
]
},
"piwik": {
"url": "https://piwik.riot.im/",
"whitelistedHSUrls": ["http://localhost:5005"],
"whitelistedISUrls": ["https://vector.im", "https://matrix.org"],
"siteId": 1
},
"enable_presence_by_hs_url": {
"https://matrix.org": false
}
}
+21
View File
@@ -0,0 +1,21 @@
#!/bin/bash
set -e
BASE_DIR=$(cd $(dirname $0) && pwd)
cd $BASE_DIR
# Install ComplexHttpServer (a drop in replacement for Python's SimpleHttpServer
# but with support for multiple threads) into a virtualenv.
(
virtualenv -p python3 env
source env/bin/activate
# Having been bitten by pip SSL fail too many times, I don't trust the existing pip
# to be able to --upgrade itself, so grab a new one fresh from source.
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python get-pip.py
rm get-pip.py
pip install ComplexHttpServer
deactivate
)
+16
View File
@@ -0,0 +1,16 @@
#!/bin/bash
set -e
ELEMENT_BRANCH=develop
if [ -d $BASE_DIR/element-web ]; then
echo "Element is already installed"
exit
fi
curl -L https://github.com/vector-im/element-web/archive/${ELEMENT_BRANCH}.zip --output element.zip
unzip -q element.zip
rm element.zip
mv element-web-${ELEMENT_BRANCH} element-web
cd element-web
yarn install
yarn run build
+54
View File
@@ -0,0 +1,54 @@
#!/usr/bin/env bash
set -e
PORT=5000
BASE_DIR=$(cd $(dirname $0) && pwd)
PIDFILE=$BASE_DIR/element.pid
CONFIG_BACKUP=config.e2etests_backup.json
if [ -f $PIDFILE ]; then
exit
fi
cd $BASE_DIR/
echo -n "Starting Element on http://localhost:$PORT ... "
pushd element-web/webapp/ > /dev/null
# backup config file before we copy template
if [ -f config.json ]; then
mv config.json $CONFIG_BACKUP
fi
cp $BASE_DIR/config-template/config.json .
LOGFILE=$(mktemp)
# run web server in the background, showing output on error
(
source $BASE_DIR/env/bin/activate
python -m ComplexHTTPServer $PORT > $LOGFILE 2>&1 &
PID=$!
echo $PID > $PIDFILE
# wait so subshell does not exit
# otherwise sleep below would not work
wait $PID; RESULT=$?
# NOT expected SIGTERM (128 + 15)
# from stop.sh?
if [ $RESULT -ne 143 ]; then
echo "Failed"
cat $LOGFILE
rm $PIDFILE 2> /dev/null
fi
rm $LOGFILE
exit $RESULT
)&
# to be able to return the exit code for immediate errors (like address already in use)
# we wait for a short amount of time in the background and exit when the first
# child process exits
sleep 0.5 &
# wait the first child process to exit (python or sleep)
wait -n; RESULT=$?
# return exit code of first child to exit
if [ $RESULT -eq 0 ]; then
echo "Running"
fi
exit $RESULT
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
set -e
BASE_DIR=$(cd $(dirname $0) && pwd)
PIDFILE=element.pid
CONFIG_BACKUP=config.e2etests_backup.json
cd $BASE_DIR
if [ -f $PIDFILE ]; then
echo "Stopping Element server ..."
PID=$(cat $PIDFILE)
rm $PIDFILE
kill $PID
# revert config file
cd element-web/webapp
rm config.json
if [ -f $CONFIG_BACKUP ]; then
mv $CONFIG_BACKUP config.json
fi
fi