blob: 12631b7ce4f0854dfec1d4351b39efd530301b34 [file] [log] [blame]
Kelvin Zhang14bca5e2021-12-15 19:19:35 +08001#!/bin/bash
yang.li09520922022-01-12 15:51:51 +08002#
yang.liffa60e52022-01-11 14:38:56 +08003# Copyright (c) 2021-2022 Amlogic, Inc. All rights reserved.
yang.li09520922022-01-12 15:51:51 +08004#
yang.liffa60e52022-01-11 14:38:56 +08005# SPDX-License-Identifier: MIT
yang.li09520922022-01-12 15:51:51 +08006#
yang.liffa60e52022-01-11 14:38:56 +08007
Kelvin Zhangdfd28382022-04-02 20:32:27 +08008source scripts/publish.sh
Kelvin Zhang14bca5e2021-12-15 19:19:35 +08009
Kelvin Zhangd64c8832022-04-02 19:56:24 +080010if [[ "$SUBMIT_TYPE" == "daily" ]] || [[ "$SUBMIT_TYPE" == "release" ]]; then
Kelvin Zhang09786122022-02-11 15:56:08 +080011 make docs
kelvin.zhang77dd5442022-02-14 10:26:15 +080012 if [ -d $LOCAL_DOC_PATH ]; then
shijie.xiongbc5d3672022-04-01 17:52:16 +080013 pushd $LOCAL_DOC_PATH >/dev/null
Kelvin Zhangd64c8832022-04-02 19:56:24 +080014 publish_docoment
Kelvin Zhang23075212022-02-11 18:26:18 +080015 if [ $? -ne 0 ]; then
16 echo "Failed to update document"
17 else
18 echo "Document updated!"
19 fi
shijie.xiongbc5d3672022-04-01 17:52:16 +080020 popd >/dev/null
Kelvin Zhang1fea9142022-02-11 18:19:56 +080021 else
Kelvin Zhang23075212022-02-11 18:26:18 +080022 echo "$LOCAL_DOC_PATH not exist!"
Kelvin Zhang7f0d2e02022-02-14 10:16:35 +080023 fi
Kelvin Zhang09786122022-02-11 15:56:08 +080024fi
25
Kelvin Zhangc18bac62022-03-14 10:31:57 +080026source scripts/gen_build_combination.sh
Kelvin Zhang69dc9fb2022-02-18 16:44:04 +080027
Kelvin Zhangd91e47e2022-08-31 20:44:20 +080028[ -z "$BUILD_LOG" ] && BUILD_LOG="output/build.log"
29# Clear build log
30cat <<EOF > $BUILD_LOG
31EOF
32
33nr=0
Kelvin Zhang14bca5e2021-12-15 19:19:35 +080034while IFS= read -r LINE; do
Kelvin Zhangd91e47e2022-08-31 20:44:20 +080035 nr=$((nr+1))
Kelvin Zhangc18bac62022-03-14 10:31:57 +080036
37 check_project "$LINE"
38 [ "$?" -ne 0 ] && continue
Kelvin Zhangd91e47e2022-08-31 20:44:20 +080039 source scripts/env.sh $LINE >> $BUILD_LOG 2>&1
40 [ "$?" -ne 0 ] && echo "Ignore unsupported combination! $LINE" && continue
kelvin.zhang05852a72022-01-19 10:30:24 +080041 make distclean
Kelvin Zhangd91e47e2022-08-31 20:44:20 +080042 [ "$?" -ne 0 ] && echo "Failed to make distclean! $LINE" && exit 2
43 echo -n "$nr. Building $LINE ... "
44 make >> $BUILD_LOG 2>&1
45 [ "$?" -ne 0 ] && echo "failed!" && exit 3
46 echo "OK!"
Xiaohu.Huang7dac8722022-01-18 16:21:29 +080047 if [[ "$SUBMIT_TYPE" == "daily" ]]; then
Kelvin Zhangd91e47e2022-08-31 20:44:20 +080048 if [[ "$BOARD" == "ad403_a113l" ]] && [[ "$ARCH" == "arm64" ]] && [[ "$PRODUCT" == "speaker" ]]; then
49 make_image >> $BUILD_LOG 2>&1
50 fi
51 publish_images >> $BUILD_LOG 2>&1
Kelvin Zhangaa84d882022-04-22 13:38:46 +080052 [ "$?" -ne 0 ] && echo "Failed to publish images!" && exit 4
bin.chen439b9342022-01-18 13:35:42 +080053 fi
shijie.xiongbc5d3672022-04-01 17:52:16 +080054done <"$BUILD_COMBINATION"
55
kelvin.zhangf59bf9a2022-02-16 10:41:47 +080056echo "Build completed!"