1 #!/bin/bash 2 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 4 # Use of this source code is governed by a BSD-style license that can be 5 # found in the LICENSE file. 6 # 7 # Author: ericli (at] google.com (Eric Li) 8 # 9 # This script copies needed files from the repo to allow Autotest CLI access 10 # from /h/b/s. 11 12 13 SCRIPT_DIR=$(cd $(dirname $0);pwd) 14 AUTOTEST_TOOLS_DIR=$(cd ${SCRIPT_DIR}/../..;pwd) 15 REPO_DIR=$(cd ${AUTOTEST_TOOLS_DIR}/../../..;pwd) 16 AUTOTEST_DIR="${REPO_DIR}/src/third_party/autotest/files" 17 18 DATESTAMP=$(date '+%Y%m%d') 19 TARGET_DIR="/home/build/static/projects-rw/chromeos/autotest.${DATESTAMP}" 20 21 cp -fpruv ${AUTOTEST_DIR}/cli ${TARGET_DIR} 22 23 mkdir -p ${TARGET_DIR}/client 24 touch ${TARGET_DIR}/client/__init__.py 25 cp -uv ${AUTOTEST_DIR}/client/setup_modules.py ${TARGET_DIR}/client 26 cp -uv ${AUTOTEST_TOOLS_DIR}/autotest/global_config.ini ${TARGET_DIR}/client 27 cp -fpruv ${AUTOTEST_DIR}/client/common_lib ${TARGET_DIR}/client 28 29 mkdir -p ${TARGET_DIR}/frontend/afe 30 touch ${TARGET_DIR}/frontend/__init__.py 31 touch ${TARGET_DIR}/frontend/afe/__init__.py 32 cp -uv ${AUTOTEST_DIR}/frontend/common.py \ 33 ${TARGET_DIR}/frontend 34 cp -fpruv ${AUTOTEST_DIR}/frontend/afe/json_rpc \ 35 ${TARGET_DIR}/frontend/afe 36 cp -uv ${AUTOTEST_DIR}/frontend/afe/rpc_client_lib.py \ 37 ${TARGET_DIR}/frontend/afe 38 cp -uv \ 39 ${AUTOTEST_TOOLS_DIR}/autotest/syncfiles/frontend/afe/site_rpc_client_lib.py \ 40 ${TARGET_DIR}/frontend/afe 41 42 # update autotest symlink 43 cd $(dirname ${TARGET_DIR}) 44 unlink autotest 45 ln -s $(basename ${TARGET_DIR}) autotest 46