您的位置 首页 Jenkins

移动apk 到指定目录

 

移动apk 到指定目录

#!/bin/bash
project="KTApp"
path=/data/jenkinsdata/workspace/KTAPP/app/build/outputs/apk/release
cd $path
#cd /data/jenkinsdata/workspace/KTAPP/app/build/outputs/apk/release
echo '11---'
#apk_na=`ll | grep apk | awk -F "." '{print $1}'`
apk_na=`ls | grep apk`  #如果多个有问题的
if [ ! -z $apk_na ];then
        cp ${apk_na} /data/android_apk/apk/${project}/${apk_na}
        cd /zzy/data/scripts/python
        #python get_img.py "http://IP:60081/${project}/${apk_na}" "/data/android_apk/img_er/${project}_${BUILD_NUMBER}.jpg"
        python get_img.py "http://IP:60081/${project}/${apk_na}" "/data/android_apk/img_er/${project}/11.jpg"

        cd /data/android_apk/apk/${project}
        spk_sum=`ls -t *.apk|wc -l`
        while [ $spk_sum -gt 5 ]
        do
          rm -f `ls -t *.apk | tail -n 1`
          spk_sum=`ls -t *.apk | wc -l`
        done

        cd /data/android_apk/img_er/${project}
        img_num=`ls -t *.jpg | wc -l`
        while [ $img_num -gt 5 ]
        do
          rm -f `ls -t *.jpg | tail -n 1`
          img_num=`ls -t *.jpg | wc -l`
        done
else
        echo "APK 包不存在,请检查 " && exit 1

fi

 

 

欢迎来撩 : 汇总all

白眉大叔

关于白眉大叔linux云计算: 白眉大叔

热门文章