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 5 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 if [ "$?" != "0" ]; then echo >&2 "Error ⛔️ upload TestFlight release"; exit 1 fi sleep 1 # Upload debug symbols to Crashlytics CRASHLYTICS_PATH=$IPA_PATH/Crashlytics $CRASHLYTICS_PATH/upload-symbols -gsp $CRASHLYTICS_PATH/GoogleService-Info.plist -p ios $CRASHLYTICS_PATH/dSYMs if [ "$?" != "0" ]; then echo >&2 "Error ⛔️ upload crashlytics debug symbols"; exit 1 fi sudo wg-quick down wg0 sleep 3 fi