Android

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash

# 编译
rm -rf Gemfile.lock
cd fastlane
bundle install

VAR1="${BUILD_TYPE}"
VAR2="debug"

if [ "$VAR1" = "$VAR2" ]; then
method="build"
else
method="release"
fi

bundle exec fastlane android $method

# 上传到APP管理平台
result=$(curl -k -F "file=@$WORKSPACE/dist/android/kidea_android_${BUILD_TYPE}.apk" <https://nas.vvusu.com:1020/app/upload>)
code_url=$(echo $result | sed 's/.*\\(http.*\\)",.*/\\1/g')
echo "code_url="$code_url > $WORKSPACE/code.txt

iOS

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# 编译
security set-key-partition-list -S apple-tool:,apple: -s -k "woaini" ~/Library/Keychains/login.keychain-db
rm -rf Gemfile.lock
cd fastlane
bundle install

VAR1="${BUILD_TYPE}"
VAR2="beta"
VAR3="debug"
if [ "$VAR1" = "$VAR2" ]; then
method="inhouse"
elif [ "$VAR1" = "$VAR3" ]; then
method="adhoc"
else
method="release"
fi

bundle exec fastlane ios $method

# 上传到APP管理平台
result=$(curl -k -F "file=@$WORKSPACE/dist/ios/kidea_ios_${method}.ipa" <https://nas.vvusu.com:1020/app/upload>)
code_url=$(echo $result | sed 's/.*\\(http.*\\)",.*/\\1/g')
echo "code_url="$code_url > $WORKSPACE/code.txt

keep 打包平台配置

iOS 配置

1
2
3
4
5
6
7
8
9
10
# 使用私有dart
export PUB_HOSTED_URL=https://dart.corp.kuaishou.com
rm -rf Gemfile.lock
rm -rf ios/Podfile.lock
bundle install
callback --url ${url} --taskid ${taskid} --jenkinsurl ${BUILD_URL} --status compile
bundle exec fastlane ios beta
commit_id=`git rev-parse --short HEAD`
upipa dist/ios/${ipa_name}.ipa dist/ios/${ipa_name}.app.dSYM.zip ${taskid} ${BUILD_URL}

Android 配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
keep打包指令:
echo "PUB_HOSTED_URL=https://dart.corp.kuaishou.com;" >> ~/.bash_profile;
echo "FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn;" >> ~/.bash_profile;
echo "export FLUTTER_ROOT=/home/jenkins/fvm/versions/v1.9.1+hotfix.6;" >> ~/.bash_profile;
source ~/.bash_profile;
echo "PATH=$PATH:$FLUTTER_ROOT/bin:$FLUTTER_ROOT/bin/cache/dart-sdk/bin:'$HOME/.pub-cache/bin';" >> ~/.bash_profile;
source ~/.bash_profile;
export http_proxy=http://oversea-squid4.sgp.txyun:11080;
export https_proxy=http://oversea-squid4.sgp.txyun:11080;
alias curl='curl -x oversea-squid4.sgp.txyun:11080';
alias wget='wget -e "http_proxy=oversea-squid4.sgp.txyun:11080"';
pub global activate fvm;
fvm use v1.9.1+hotfix.6;
flutter doctor --verbose;
echo ${PATH};
flutter pub cache repair;
fvm flutter pub get;