zoukankan      html  css  js  c++  java
  • curl

    #!/bin/bash
    
    
    # 驱动名字
    driverName="GB_test_mhx"
    # 平台
    versionNo="v3.0.0"
    version="official"
    
    cd ..
    
    staticCurl="curl --location --request POST "http://192.168.20.31/api/appStoreAdmin/drivers/file/upload"
    --form "appFiles=@./$driverName"
    --form "appName=$driverName" 
    --form "versionNo=$versionNo" 
    --form "version=$version"
    --form "configFiles=@./pkg/config.json"
    --form "configFiles=@./pkg/config.csv"
     "
    
    # 参数: 1. 文件夹名字  2. 平台platform
    funLib(){
    	echo "编译的平台: ${2}"
    	tmpCurl=$staticCurl
    	if [ "$(ls -A $1)" ];then
    	  echo "${1}文件夹存在"
    		folder=$1
    
    		softfiles=$(ls $folder)
    		# 拼接平台
    		tmpCurl="${tmpCurl} --form "platform=$2" "
    		for sfile in ${softfiles}
    				do
    					tmpCurl="${tmpCurl} --form "configFiles=@${1}/${sfile}""
    				done
    		echo "拼接结果: ${tmpCurl}, and 开始传输给云平台"
    		
    	else
    	  echo "${1}文件夹不存在"
    		# 拼接平台
    		tmpCurl="${tmpCurl} --form "platform=$2" "
    		echo "拼接结果: ${tmpCurl}, and 开始传输给云平台"
    	fi
    	
    	${tmpCurl}
    }
    
    # 编译amd64,并且发布到平台
    rm -rf $driverName
    xgo --targets=linux/amd64 -ldflags='-s -w'  -go go-1.16.4 -dest=. -pkg="." -out=$driverName .
    cp ${driverName}-linux-amd64 $driverName
    funLib "./linux-amd64" "linux-amd64"
    
    # 编译386
    rm -rf $driverName
    xgo --targets=linux/386 -ldflags='-s -w'  -go go-1.16.4 -dest=. -pkg="." -out=$driverName .
    cp ${driverName}-linux-386 $driverName
    funLib "./linux-386" "linux-386"
    
    # 编译arm5
    rm -rf $driverName
    xgo --targets=linux/arm-5 -ldflags='-s -w'  -go go-1.16.4 -dest=. -pkg="." -out=$driverName .
    cp ${driverName}-linux-arm-5 $driverName
    funLib "./linux-arm5" "linux-arm5"
    
    # 编译arm6
    rm -rf $driverName
    xgo --targets=linux/arm-6 -ldflags='-s -w'  -go go-1.16.4 -dest=. -pkg="." -out=$driverName .
    cp ${driverName}-linux-arm-6 $driverName
    funLib "./linux-arm6" "linux-arm6"
    
    # 编译arm7
    rm -rf $driverName
    xgo --targets=linux/arm-7 -ldflags='-s -w'  -go go-1.16.4 -dest=. -pkg="." -out=$driverName .
    cp ${driverName}-linux-arm-7 $driverName
    funLib "./linux-arm7" "linux-arm7"
    
    
  • 相关阅读:
    k-means算法
    偏差-方差分解Bias-Variance Decomposition
    常见machine learning模型实现
    Bag-of-words模型、TF-IDF模型
    atomic原子操作
    oc 计算 带括号 式子
    oc 基本语法 类 静态变量 常量
    通过文件头标识判断图片格式
    十大经典排序算法最强总结(含JAVA代码实现)(转)
    JPEG格式 介绍
  • 原文地址:https://www.cnblogs.com/maomaomaoge/p/15791723.html
Copyright © 2011-2022 走看看