blob: 06cd7ecd830e6c6cad529fbc4987009eade2bd2b [file] [log] [blame]
Congbin Guoe84118c2018-03-30 18:38:58 -07001#!/bin/bash
2# Copyright 2018 The Chromium OS Authors. All rights reserved.
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
Congbin Guof092e062018-04-26 19:02:27 -07006# Run Google Storage archive server from inside virtual environment.
Congbin Guoe84118c2018-03-30 18:38:58 -07007set -eu
Congbin Guof092e062018-04-26 19:02:27 -07008readonly bindir=$(dirname -- "$(readlink -e -- "$0")")
9readonly homedir=$(cd "$bindir"/../gs_cache; pwd)
10export PYTHONPATH=$homedir
Congbin Guoe84118c2018-03-30 18:38:58 -070011
Congbin Guof092e062018-04-26 19:02:27 -070012# Run the server, or run tests
13if [[ $(basename "$0") == gs_archive_server_test ]]; then
14 exec vpython -vpython-spec $homedir/.vpython -m pytest \
15 "$homedir"/gs_archive_server_test.py "$@"
16else
17 exec vpython -vpython-spec $homedir/.vpython -m gs_archive_server "$@"
18fi