| #!/bin/bash |
| # Copyright 2018 The Chromium OS Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| # Run Google Storage archive server from inside virtual environment. |
| set -eu |
| readonly bindir=$(dirname -- "$(readlink -e -- "$0")") |
| readonly homedir=$(cd "$bindir"/../gs_cache; pwd) |
| export PYTHONPATH=$homedir |
| |
| # Run the server, or run tests |
| if [[ $(basename "$0") == gs_archive_server_test ]]; then |
| exec vpython -vpython-spec $homedir/.vpython -m pytest \ |
| "$homedir"/gs_archive_server_test.py "$@" |
| else |
| exec vpython -vpython-spec $homedir/.vpython -m gs_archive_server "$@" |
| fi |