| Index: appengine/findit_mock/scripts/run.sh
|
| diff --git a/appengine/findit/util_scripts/run.sh b/appengine/findit_mock/scripts/run.sh
|
| similarity index 65%
|
| copy from appengine/findit/util_scripts/run.sh
|
| copy to appengine/findit_mock/scripts/run.sh
|
| index 0e37570a08f11ece216661b458793c9b95f75276..52953c17d92de0302ddd4d529587e36adda90ff5 100755
|
| --- a/appengine/findit/util_scripts/run.sh
|
| +++ b/appengine/findit_mock/scripts/run.sh
|
| @@ -12,13 +12,16 @@ FINDIT_DIR="${THIS_SCRIPT_DIR}/.."
|
| INFRA_DIR="${FINDIT_DIR}/../.."
|
| GOOGLE_APP_ENGINE_DIR="${INFRA_DIR}/../google_appengine"
|
| has_realpath="$(which realpath > /dev/null && echo 0)"
|
| -if [[ has_realpath == "0" ]]; then
|
| +if [[ ${has_realpath} == "0" ]]; then
|
| FINDIT_DIR="$(realpath ${FINDIT_DIR})"
|
| INFRA_DIR="$(realpath ${INFRA_DIR})"
|
| GOOGLE_APP_ENGINE_DIR="$(realpath ${GOOGLE_APP_ENGINE_DIR})"
|
| fi
|
| APP_CFG="${GOOGLE_APP_ENGINE_DIR}/appcfg.py"
|
| -FINDIT_MODULES="${FINDIT_DIR}/app.yaml ${FINDIT_DIR}/waterfall-frontend.yaml ${FINDIT_DIR}/waterfall-backend.yaml ${FINDIT_DIR}/crash-frontend.yaml ${FINDIT_DIR}/crash-backend-fracas.yaml"
|
| +
|
| +DEFAULT_MODULE="${FINDIT_DIR}/app.yaml"
|
| +OTHER_MODULES="${FINDIT_DIR}/frontend.yaml ${FINDIT_DIR}/backend.yaml"
|
| +
|
|
|
| if [[ -z "${USER}" ]]; then
|
| echo "Cannot identify who is deploying Findit. Please set USER."
|
| @@ -37,11 +40,11 @@ print_usage() {
|
| echo "$0 <command>"
|
| echo
|
| echo "Supported commands:"
|
| - echo " test Run the unittest"
|
| - echo " run Run Findit locally"
|
| - echo " deploy-prod Deploy Findit to findit-for-me for release"
|
| - echo " deploy-test-dev Deploy Findit to findit-for-me-dev for test"
|
| - echo " deploy-test-prod Deploy Findit to findit-for-me for staging test"
|
| + echo " test Run unittests"
|
| + echo " run Run Findit locally"
|
| + echo " deploy-prod Deploy Findit to findit-for-me for release"
|
| + echo " deploy-test-prod Deploy Findit to findit-for-me for test"
|
| + echo " deploy-staging Deploy Findit to findit-for-me-staging for test"
|
| exit 1
|
| }
|
|
|
| @@ -57,52 +60,51 @@ print_command_for_queue_cron_dispatch() {
|
| }
|
|
|
| run_unittests() {
|
| - local findit="appengine/findit"
|
| + local findit="appengine/findit_mock"
|
| local coverage_report_parent_dir="${TMP_DIR}/coverage"
|
| - # TODO: move this directory autovivification to test.py itself
|
| mkdir -p ${coverage_report_parent_dir}
|
| python ${INFRA_DIR}/test.py test ${findit} --html-report ${coverage_report_parent_dir}
|
| [ $? -ne 0 ] || echo "Code coverage report file://${coverage_report_parent_dir}/${findit}/index.html"
|
| }
|
|
|
| -run_findit_locally() {
|
| +run_locally() {
|
| local storage_path="${TMP_DIR}/findit"
|
| local options="--storage_path ${storage_path}"
|
| - # TODO: move this directory autovivification to dev_appserver.py itself
|
| mkdir -p "${storage_path}"
|
| - python ${GOOGLE_APP_ENGINE_DIR}/dev_appserver.py ${options} ${FINDIT_DIR}/dispatch.yaml ${FINDIT_MODULES}
|
| + # Because of the reference in dispatch.yaml, we have to run all modules.
|
| + python ${GOOGLE_APP_ENGINE_DIR}/dev_appserver.py ${options} ${FINDIT_DIR}/dispatch.yaml ${DEFAULT_MODULE} ${OTHER_MODULES}
|
| }
|
|
|
| -deploy_findit_for_test() {
|
| +deploy_for_test() {
|
| # Deploy a version for testing, the version name is the same as the user name.
|
| - if [[ -z ${APP_ID} ]]; then
|
| - if [[ "$1" == "prod" ]]; then
|
| + local app_id_to_use=${APP_ID}
|
| + local app_env=$1
|
| + if [[ -z ${app_id_to_use} ]]; then
|
| + if [[ "${app_env}" == "prod" ]]; then
|
| local app_id_to_use="findit-for-me"
|
| else
|
| - local app_id_to_use="findit-for-me-dev"
|
| + local app_id_to_use="findit-for-me-staging"
|
| fi
|
| - else
|
| - local app_id_to_use=${APP_ID}
|
| fi
|
| echo "app id is ${app_id_to_use}"
|
|
|
| local new_version=${USER}
|
|
|
| echo "-----------------------------------"
|
| - python ${APP_CFG} update -A ${app_id_to_use} $FINDIT_MODULES --version ${new_version}
|
| + python ${APP_CFG} update -A ${app_id_to_use} --version ${new_version} ${DEFAULT_MODULE} ${OTHER_MODULES}
|
| echo "-----------------------------------"
|
| print_command_for_queue_cron_dispatch ${app_id_to_use}
|
| echo "-----------------------------------"
|
| echo Findit was deployed to "https://${new_version}-dot-${app_id_to_use}.appspot.com/"
|
| }
|
|
|
| -deploy_findit_for_prod() {
|
| +deploy_for_prod() {
|
| local app_id="findit-for-me"
|
|
|
| # Sync to latest code.
|
| local update_log="${TMP_DIR}/update.log"
|
| echo "Syncing code to tip of tree, logging in ${update_log} ..."
|
| - local update="0" #"$(cd ${INFRA_DIR} && git pull >>${update_log} 2>>${update_log} && gclient sync >>$update_log >>${update_log} 2>>${update_log} && echo $?)"
|
| + local update="0" #"$(cd ${INFRA_DIR} && git pull >>${update_log} 2>>${update_log} && gclient sync >>${update_log} >>${update_log} 2>>${update_log} && echo $?)"
|
| if [[ "${update}" != "0" ]]; then
|
| echo "Failed to run 'git pull && gclient sync'!"
|
| echo "Please check log at ${update_log}"
|
| @@ -141,7 +143,7 @@ deploy_findit_for_prod() {
|
|
|
| echo
|
| echo "-----------------------------------"
|
| - python ${APP_CFG} update -A ${app_id} $FINDIT_MODULES --version ${new_version}
|
| + python ${APP_CFG} update -A ${app_id} --version ${new_version} ${DEFAULT_MODULE} ${OTHER_MODULES}
|
| echo "-----------------------------------"
|
| print_command_for_queue_cron_dispatch ${app_id}
|
| echo "-----------------------------------"
|
| @@ -149,19 +151,27 @@ deploy_findit_for_prod() {
|
|
|
| echo "New version '${new_version}' of Findit was deployed to ${app_id}."
|
|
|
| - local dashboard_url="https://${new_version}-dot-waterfall-frontend-dot-${app_id}.appspot.com/waterfall/list-analyses"
|
| - echo "Please force a re-run of a recent build failure on dashboard ${dashboard_url},"
|
| - echo "ensure that the analysis is run in the new-version waterfall frontend & backend and gives correct results,"
|
| - echo "and then set the new version ${new_version} as default for three modules default, waterfall-frontend and waterfall-backend."
|
| + app_console_url="https://pantheon.corp.google.com/appengine/versions?project=${app_id}"
|
| + local dashboard_url="https://${new_version}-dot-${service_frontend}-dot-${app_id}.appspot.com/waterfall/list-analyses"
|
| + echo "Please force a re-run of a recent build failure on the dashboard ${dashboard_url},"
|
| + echo "ensure that the analysis is run in the new-version findit frontend & backend and gives correct results."
|
| + echo
|
| + echo "Then press [ENTER] to confirm that the new version works as expected:"
|
| + read unused_var
|
| + echo
|
| + echo "Now please set the new version ${new_version} as default for the modules default, frontend and backend on ${app_console_url}."
|
| + echo "Then press [ENTER] to confirm that the new version was set default:"
|
| + read unused_var
|
| echo
|
|
|
| - local change_log_url="https://chromium.googlesource.com/infra/infra/+log/${current_version}..${new_version}/appengine/findit"
|
| - echo "If the release is for findit-for-me, please email chrome-findit with the following:"
|
| - echo "Subject: Release: findit-for-me updated to ${new_version}."
|
| + local change_logs_url="https://chromium.googlesource.com/infra/infra/+log/${current_version}..${new_version}/appengine/findit"
|
| + echo "Please email chrome-findit@ with the following:"
|
| + echo
|
| + echo "Subject: Release: ${app_id} updated to ${new_version}."
|
| echo "Hi all,"
|
| echo
|
| - echo "The app findit-for-me was updated from ${current_version} to ${new_version}."
|
| - echo "Changelogs: ${change_log_url}"
|
| + echo "The app ${app_id} was updated from ${current_version} to ${new_version}."
|
| + echo "Changelogs: ${change_logs_url}"
|
| echo
|
| echo "If your bug fixes/features are included in the release, please verify on ${app_id} and mark them as verified on http://crbug.com"
|
| echo
|
| @@ -174,16 +184,16 @@ case "$1" in
|
| run_unittests
|
| ;;
|
| run)
|
| - run_findit_locally
|
| + run_locally
|
| ;;
|
| deploy-prod)
|
| - deploy_findit_for_prod
|
| - ;;
|
| - deploy-test-dev)
|
| - deploy_findit_for_test "dev"
|
| + deploy_for_prod
|
| ;;
|
| deploy-test-prod)
|
| - deploy_findit_for_test "prod"
|
| + deploy_for_test "prod"
|
| + ;;
|
| + deploy-staging)
|
| + deploy_for_test "dev"
|
| ;;
|
| *)
|
| print_usage
|
|
|