Page MenuHomePhabricator
Paste P13055

Run Toolhub test-python step locally
ActivePublic

Authored by bd808 on Oct 22 2020, 4:50 PM.
Referenced Files
F32411180: Run Toolhub test-python step locally
Oct 22 2020, 4:50 PM
Subscribers
None
#!/bin/bash
set -euxo pipefail
ZUUL_CHANGE=${1:?Gerrit changeset id required}
TMP_DIR=$(mktemp -d -t run-pipeline-XXXXXXXXXX)
trap 'rm -rf "$TMP_DIR"' EXIT
echo "Running test pipeline in $TMP_DIR"
cd $TMP_DIR
git clone "https://gerrit.wikimedia.org/r/wikimedia/toolhub" .
git-review --download $ZUUL_CHANGE
make .pipeline/test-python.Dockerfile
cat .pipeline/test-python.Dockerfile
docker build --pull --force-rm=true \
--file .pipeline/test-python.Dockerfile . -t toolhub:test-python
docker run --rm \
-e DJANGO_SECRET_KEY=NOTAREALSECRET \
-e DB_ENGINE=django.db.backends.sqlite3 \
-e DB_NAME=:memory: \
-e WIKIMEDIA_OAUTH2_KEY=NOTAREALOAUTHKEY \
-e WIKIMEDIA_OAUTH2_SECRET=NOTAREALOAUTHSECRET \
toolhub:test-python &&
echo "Exit status: $?"