blob: 0972d1179a1209695598bfc95d352ffa42833e0f [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 Zhang14bca5e2021-12-15 19:19:35 +080028i=0
29while IFS= read -r LINE; do
30 [[ "$i" -ne 0 ]] && echo ""
shijie.xiongbc5d3672022-04-01 17:52:16 +080031 i=$((i + 1))
Kelvin Zhang0f582792022-08-31 18:52:20 +080032 echo BUILD_LOG $BUILD_LOG
Kelvin Zhangc18bac62022-03-14 10:31:57 +080033
34 check_project "$LINE"
35 [ "$?" -ne 0 ] && continue
Kelvin Zhang14bca5e2021-12-15 19:19:35 +080036 source scripts/env.sh $LINE
kelvin.zhangb7217852022-03-10 11:18:18 +080037 [ "$?" -ne 0 ] && echo "Ignore unsupported combination!" && continue
kelvin.zhang05852a72022-01-19 10:30:24 +080038 make distclean
Xiaohu.Huangb6ad9762022-02-11 17:49:09 +080039 [ "$?" -ne 0 ] && echo "Failed to make distclean!" && exit 2
bin.chene9875112022-01-18 15:00:50 +080040 make
Kelvin Zhang8ce1b6e2022-05-30 17:36:49 +080041 [ "$?" -ne 0 ] && echo "Failed to build!" && exit 3
Xiaohu.Huang7dac8722022-01-18 16:21:29 +080042 if [[ "$SUBMIT_TYPE" == "daily" ]]; then
bin.chen1ae21872022-07-27 15:11:21 +080043 if [[ "$BOARD" == "ad403_a113l" ]] && [[ "$ARCH" == "arm64" ]] && [[ "$PRODUCT" == "speaker" ]]; then
44 make_image
45 fi
Kelvin Zhangaa84d882022-04-22 13:38:46 +080046 publish_images
47 [ "$?" -ne 0 ] && echo "Failed to publish images!" && exit 4
bin.chen439b9342022-01-18 13:35:42 +080048 fi
shijie.xiongbc5d3672022-04-01 17:52:16 +080049done <"$BUILD_COMBINATION"
50
kelvin.zhangf59bf9a2022-02-16 10:41:47 +080051echo "Build completed!"