Dan McGregor | feaee26 | 2016-11-29 07:41:27 -0600 | [diff] [blame^] | 1 | #!/usr/bin/env bash |
Dave Borowitz | 3aeefe3 | 2015-12-03 13:43:16 -0500 | [diff] [blame] | 2 | # Copyright (C) 2015 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | set -eu |
| 17 | |
David Ostrovsky | fdbfcad | 2016-11-15 06:35:29 -0800 | [diff] [blame] | 18 | while [[ ! -f WORKSPACE && "$PWD" != / ]]; do |
Dave Borowitz | 3aeefe3 | 2015-12-03 13:43:16 -0500 | [diff] [blame] | 19 | cd .. |
| 20 | done |
David Ostrovsky | fdbfcad | 2016-11-15 06:35:29 -0800 | [diff] [blame] | 21 | if [[ ! -f WORKSPACE ]]; then |
Dave Borowitz | 3aeefe3 | 2015-12-03 13:43:16 -0500 | [diff] [blame] | 22 | echo "$(basename "$0"): must be run from a gerrit checkout" 1>&2 |
| 23 | exit 1 |
| 24 | fi |
| 25 | |
David Ostrovsky | fdbfcad | 2016-11-15 06:35:29 -0800 | [diff] [blame] | 26 | bazel build \ |
Viktar Donich | 8f5b9aa | 2017-01-24 13:57:15 -0800 | [diff] [blame] | 27 | //polygerrit-ui/app:test_components \ |
David Ostrovsky | fdbfcad | 2016-11-15 06:35:29 -0800 | [diff] [blame] | 28 | //polygerrit-ui:fonts.zip |
Viktar Donich | 5eb59e3 | 2016-03-15 10:56:06 -0700 | [diff] [blame] | 29 | |
Urs Wolfer | 0f537c7 | 2016-03-30 20:01:33 +0200 | [diff] [blame] | 30 | cd polygerrit-ui/app |
Dave Borowitz | 3aeefe3 | 2015-12-03 13:43:16 -0500 | [diff] [blame] | 31 | rm -rf bower_components |
Viktar Donich | 8f5b9aa | 2017-01-24 13:57:15 -0800 | [diff] [blame] | 32 | unzip -q ../../bazel-bin/polygerrit-ui/app/test_components.zip |
Viktar Donich | 5eb59e3 | 2016-03-15 10:56:06 -0700 | [diff] [blame] | 33 | rm -rf fonts |
David Ostrovsky | fdbfcad | 2016-11-15 06:35:29 -0800 | [diff] [blame] | 34 | unzip -q ../../bazel-bin/polygerrit-ui/fonts.zip -d fonts |
Urs Wolfer | 0f537c7 | 2016-03-30 20:01:33 +0200 | [diff] [blame] | 35 | cd .. |
| 36 | exec go run server.go "$@" |