同步操作将从 ApolloAuto/apollo 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
#!/usr/bin/env bash################################################################################ Copyright 2017 The Apollo Authors. All Rights Reserved.## Licensed under the Apache License, Version 2.0 (the "License");# you may not use this file except in compliance with the License.# You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing, software# distributed under the License is distributed on an "AS IS" BASIS,# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.###############################################################################DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"cd "${DIR}"# the machine type, currently support x86_64, aarch64MACHINE_ARCH=$(uname -m)source ${DIR}/scripts/apollo_base.shTIME=$(date +%Y%m%d_%H%M)if [ -z "${DOCKER_REPO}" ]; thenDOCKER_REPO=apolloauto/apollofifunction print_usage() {RED='033円[0;31m'BLUE='033円[0;34m'BOLD='033円[1m'NONE='033円[0m'echo -e "\n${RED}Usage${NONE}:.${BOLD}/apollo_docker.sh${NONE} [OPTION]"echo -e "\n${RED}Options${NONE}:${BLUE}build${NONE}: run build only${BLUE}build_opt${NONE}: build optimized binary for the code${BLUE}build_gpu${NONE}: run build only with Caffe GPU mode support${BLUE}build_opt_gpu${NONE}: build optimized binary with Caffe GPU mode support${BLUE}build_fe${NONE}: compile frontend javascript code, this requires all the node_modules to be installed already${BLUE}buildify${NONE}: fix style of BUILD files${BLUE}check${NONE}: run build/lint/test, please make sure it passes before checking in new code${BLUE}clean${NONE}: run Bazel clean${BLUE}config${NONE}: run configurator tool${BLUE}coverage${NONE}: generate test coverage report${BLUE}doc${NONE}: generate doxygen document${BLUE}lint${NONE}: run code style check${BLUE}usage${NONE}: print this menu${BLUE}release${NONE}: build release version${BLUE}test${NONE}: run all unit tests${BLUE}version${NONE}: display current commit and date${BLUE}push${NONE}: pushes the images to Docker hub${BLUE}gen${NONE}: generate a docker release image${BLUE}ota_gen${NONE}: generate an ota docker release image"}function start_build_docker() {docker ps --format "{{.Names}}" | grep apollo_dev_$USER 1>/dev/null 2>&1if [ $? != 0 ]; then# If Google is reachable, we fetch the docker image directly.if ping -q -c 1 -W 1 www.google.com 1>/dev/null 2>&1; thenopt=""elseping -q -c 1 -W 1 www.baidu.com 1>/dev/null 2>&1# If Baidu is unreachable, we use local images.if [ $? -ne 0 ]; thenopt="-l"fifibash docker/scripts/dev_start.sh ${opt}fi}function gen_docker() {IMG="apolloauto/apollo:run-${MACHINE_ARCH}-20181017_1330"RELEASE_DIR=${HOME}/.cache/apollo_releaseAPOLLO_DIR="${RELEASE_DIR}/apollo"if [ ! -d "${APOLLO_DIR}" ]; thenecho "Release directory does not exist!"exit 1fiRELEASE_NAME="${DOCKER_REPO}:release-${MACHINE_ARCH}-${TIME}"DEFAULT_NAME="${DOCKER_REPO}:release-${MACHINE_ARCH}-latest"docker pull $IMGecho "time : ${TIME}" >> ${APOLLO_DIR}/meta.iniecho "tag: ${RELEASE_NAME}" >> ${APOLLO_DIR}/meta.inidocker ps -a --format "{{.Names}}" | grep 'apollo_release' 1>/dev/nullif [ $? == 0 ];thendocker stop apollo_release 1>/dev/nulldocker rm -f apollo_release 1>/dev/nullfidocker run -it \-d \--name apollo_release \--net host \-v $HOME/.cache:/root/mnt \-w /apollo \"$IMG"if [ "$OTA_RELEASE" != "1" ]; thendocker exec apollo_release bash -c 'cp -Lr /root/mnt/apollo_release/apollo /'elseRELEASE_TGZ="apollo_release.tar.gz"SEC_RELEASE_TGZ="sec_apollo_release.tar.gz"if [ -e "$HOME/.cache/$RELEASE_TGZ" ]; thenrm $HOME/.cache/$RELEASE_TGZfiif [ -e "$HOME/.cache/$SEC_RELEASE_TGZ" ]; thenrm $HOME/.cache/$SEC_RELEASE_TGZfi# generate security release packagetar czf $HOME/.cache/$RELEASE_TGZ -C $HOME/.cache apollo_releasepython modules/tools/ota/create_sec_package.pydocker exec apollo_release cp /root/mnt/${SEC_RELEASE_TGZ} /rootfiCONTAINER_ID=$(docker ps | grep apollo_release | awk '{print 1ドル}')docker commit "$CONTAINER_ID" "$DEFAULT_NAME"docker tag "$DEFAULT_NAME" "$RELEASE_NAME"docker stop "$CONTAINER_ID"}function push() {DEFAULT_NAME="${DOCKER_REPO}:release-${MACHINE_ARCH}-latest"LATEST_IMAG_ID=$(docker images --format "{{.Repository}}:{{.Tag}} {{.ID}}" | grep "${DEFAULT_NAME}" | cut -d " " -f 2)RELEASE_NAME=$(docker images --format "{{.Repository}}:{{.Tag}} {{.ID}}" | grep ${LATEST_IMAG_ID}| grep -v "${DEFAULT_NAME}" | cut -d " " -f 1)docker push "$DEFAULT_NAME"docker push "$RELEASE_NAME"}if [ $# == 0 ];thenprint_usageexit 1fistart_build_dockercase 1ドル inprint_usage)print_usage;;push)push;;gen)gen_docker;;ota_gen)OTA_RELEASE=1gen_docker;;*)docker exec -u $USER apollo_dev_$USER bash -c "./apollo.sh $@";;esac
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。