Commit a5f4b04b authored by zhouzhenyu's avatar zhouzhenyu
Browse files

zzy:upload function

parent 25222184
......@@ -20,6 +20,10 @@ ORGCODE=""
CHANNELID=""
IMAGE_FILE=""
# new append
NOUPLOAD="false"
LOCAL="false"
export PATH=${PATH}:$(pwd)/tools/
PARSED_ARUGMENTS=$(getopt -a -n "$0" -o V:t:i: --long help,vendor:,type:,image:,chroot-type:,orgcode:,channelid:, -- "$@")
eval set -- "${PARSED_ARUGMENTS}"
......@@ -112,9 +116,43 @@ update_hugepall_zipfile() {
zip -u -j "$hugep_zip_file" "$yaml_file"
}
upload() {
# get current time
local date_i=$(date +%Y-%m-%d-%s)
echo "$date_i"
echo "line 34 end"
echo "$IMAGE_FILE"
outfile=$(basename "$IMAGE_FILE")
echo "$outfile"
MD5SUM=$(md5sum ${outfile} | awk '{print $1}' )
if [[ "$NOUPLOAD" != "true" ]]
then
7z a -mm=LZMA2 $outfile.7z $outfile
old_outfile=$outfile
rm -f $old_outfile
outfile=$outfile.7z
# upload to dir
upload.sh $args --file ${outfile} --directory product/terminal/chroot_androidrom/${ORGCODE}/${date_i}
# construct URL
IMG_URL="https://cdn.linkfog.cn/""product/terminal/chroot_androidrom/${ORGCODE}/${date_i}"
# title
TITLE="???Armbian ???,VENDOR:${VENDOR},ORGCODE:${ORGCODE} ${date}"
mail.sh ${VENDOR} ${IMG_URL} ${MD5SUM} ${TITLE} 2>/dev/null
echo "RESULT: ${VENDOR} ${IMG_URL} ${MD5SUM} ${TITLE}"
# delete .img file
rm -f ${outfile}
fi
}
export PATH="$PATH":"$(pwd)"/tools/
generate_vendor_confg
update_hugepall_zipfile
build_image "$IMAGE_FILE"
upload
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment