| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # | 2 # |
| 3 # Copyright 2015 The Chromium Authors. All rights reserved. | 3 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 # | 6 # |
| 7 # This script is to ease running Findit locally, running its unit tests, and | 7 # This script is to ease running Findit locally, running its unit tests, and |
| 8 # deploying Findit to App Engine. | 8 # deploying Findit to App Engine. |
| 9 | 9 |
| 10 THIS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE:-$0}" )" && pwd )" | 10 THIS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE:-$0}" )" && pwd )" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 echo "If there is any change to cron.yaml, dispatch.yaml, index.yaml, or" | 44 echo "If there is any change to cron.yaml, dispatch.yaml, index.yaml, or" |
| 45 echo " queue.yaml since last deployment, please run appropriate commands" | 45 echo " queue.yaml since last deployment, please run appropriate commands" |
| 46 echo " below to update them:" | 46 echo " below to update them:" |
| 47 echo " ${APP_CFG} update_cron -A $1 ${FINDIT_DIR}" | 47 echo " ${APP_CFG} update_cron -A $1 ${FINDIT_DIR}" |
| 48 echo " ${APP_CFG} update_dispatch -A $1 ${FINDIT_DIR}" | 48 echo " ${APP_CFG} update_dispatch -A $1 ${FINDIT_DIR}" |
| 49 echo " ${APP_CFG} update_indexes -A $1 ${FINDIT_DIR}" | 49 echo " ${APP_CFG} update_indexes -A $1 ${FINDIT_DIR}" |
| 50 echo " ${APP_CFG} update_queues -A $1 ${FINDIT_DIR}" | 50 echo " ${APP_CFG} update_queues -A $1 ${FINDIT_DIR}" |
| 51 } | 51 } |
| 52 | 52 |
| 53 run_unittests() { | 53 run_unittests() { |
| 54 local coverage_report_dir="${TMP_DIR}/coverage" | 54 local findit="appengine/findit" |
| 55 python ${INFRA_DIR}/test.py test appengine/findit --html-report ${coverage_rep
ort_dir} | 55 local coverage_report_parent_dir="${TMP_DIR}/coverage" |
| 56 echo "Code coverage report file://${coverage_report_dir}/index.html" | 56 if [ ! -d ${coverage_report_parent_dir} ]; then |
| 57 mkdir -p ${coverage_report_parent_dir} |
| 58 fi |
| 59 python ${INFRA_DIR}/test.py test ${findit} --html-report ${coverage_report_par
ent_dir} |
| 60 echo "Code coverage report file://${coverage_report_parent_dir}/${findit}/inde
x.html" |
| 57 } | 61 } |
| 58 | 62 |
| 59 run_findit_locally() { | 63 run_findit_locally() { |
| 60 local options="--storage_path ${TMP_DIR}/findit" | 64 local options="--storage_path ${TMP_DIR}/findit" |
| 61 python ${GOOGLE_APP_ENGINE_DIR}/dev_appserver.py ${options} ${FINDIT_DIR}/disp
atch.yaml ${FINDIT_MODULES} | 65 python ${GOOGLE_APP_ENGINE_DIR}/dev_appserver.py ${options} ${FINDIT_DIR}/disp
atch.yaml ${FINDIT_MODULES} |
| 62 } | 66 } |
| 63 | 67 |
| 64 deploy_findit_for_test() { | 68 deploy_findit_for_test() { |
| 65 # Deploy a version for testing, the version name is the same as the user name. | 69 # Deploy a version for testing, the version name is the same as the user name. |
| 66 if [[ -z ${APP_ID} ]]; then | 70 if [[ -z ${APP_ID} ]]; then |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 deploy-test-dev) | 174 deploy-test-dev) |
| 171 deploy_findit_for_test "dev" | 175 deploy_findit_for_test "dev" |
| 172 ;; | 176 ;; |
| 173 deploy-test-prod) | 177 deploy-test-prod) |
| 174 deploy_findit_for_test "prod" | 178 deploy_findit_for_test "prod" |
| 175 ;; | 179 ;; |
| 176 *) | 180 *) |
| 177 print_usage | 181 print_usage |
| 178 ;; | 182 ;; |
| 179 esac | 183 esac |
| OLD | NEW |