Jenkins Android 打包

#!/bin/bash
#echo "" >> gradle.properties
#echo "systemProp.http.proxyHost=172.50.1.181" >> gradle.properties
#echo "systemProp.http.proxyPort=8888" >> gradle.properties
#echo "systemProp.https.proxyHost=172.50.1.181" >> gradle.properties
#echo "systemProp.https.proxyPort=8888" >> gradle.properties
#export GRADLE_HOME=/home/dev/.gradle/wrapper/dists/gradle-4.4-all/9br9xq1tocpiv8o6njlyu5op1/gradle-4.4
#export GRADLE_HOME=/home/dev/Downloads/android-studio/gradle/gradle-5.1.1
#export PATH=$GRADLE_HOME/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
#export JAVA_HOME=/home/dev/Downloads/android-studio/jre
#export ANDROID_HOME=/home/dev/Android/Sdk
#mkdir -p tztApp/keystore
#cp /home/dev/release.keystore tztApp/keystore/release.keystore

echo $WORKSPACE
echo "" >> gradle.properties
echo "android.enableBuildCache=true" >> gradle.properties
export GRADLE_HOME=/Users/geektest/.gradle/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1
export PATH=$GRADLE_HOME/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_221.jdk/Contents/Home
export ANDROID_HOME=/Users/geektest/Library/Android/sdk
mkdir -p tztApp/keystore
cp /Users/geektest/jenkins/release.keystore tztApp/keystore/release.keystore

cd tztApp
gradle clean
arr=$(echo $TEST_ENV_PORT|tr "," "\n")
for x in $arr; do
	if [ $x = "assembleGszqNCprod" ] || [ $x = "assembleStg" ]; then
    	echo "### copy server.xml ###"
        rm -rf src/main/assets/servers.xml
		cp ../servers.xml src/main/assets
        rm -rf src/main/res/xml/http_address.xml
        cp ../http_address.xml src/main/res/xml
        # cp ../gscl_config.properties src/main/assets
    elif [ $x = "assembleGszqSHtest_27777" ]; then
        rm -rf src/main/res/xml/http_address.xml
        cp ../cs_http_address.xml src/main/res/xml/http_address.xml    
	fi
	echo "### start to build $x"
    gradle $x   
done
herui

一枚干着DevOps工作的职业命理师

发表评论

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据