Files
raspberry/toolchain/deploy_iOS.sh
T
2022-07-21 11:42:59 +03:00

47 lines
1.0 KiB
Bash

unlock_login_keychain() {
if [ -z "$1" ]; then
echo "Password parameter must be exists"
return 1
fi
local timeout=3600
if [ -n "$2" ]; then
timeout=$2
fi
security list-keychains -s ~/Library/Keychains/login.keychain-db
security unlock-keychain -p $1 ~/Library/Keychains/login.keychain-db
security set-keychain-settings -t $timeout -l ~/Library/Keychains/login.keychain-db
}
#Passed external variables
IPA_DEPLOY_TARGET=$1
IPA_PATH=$2
IPA_NAME=$3
#Several cases for uploading created ipa.
if [ "$IPA_DEPLOY_TARGET" == "TESTFLIGHT" ]; then
#git log --pretty=format:'%h %s' -n $1 > $2
unlock_login_keychain "$K8S_SECRET_SPOCK"
sudo wg-quick down wg0
sleep 3
sudo wg-quick up wg0
sleep 5
curl -s ifconfig.me ; echo
# Upload
xcrun altool --upload-app --type ios --username "$K8S_NORATIZATION_EMAIL" --password "$K8S_SECRET_NOTARIZATION" --file $IPA_PATH/$IPA_NAME.ipa
sudo wg-quick down wg0
sleep 3
if [ "$?" != "0" ]; then
echo >&2 "Error ⛔️ upload failed";
exit 1
fi
fi