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 #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_JARVIS" # Upload for BETA and PRODUCTION xcrun altool --upload-app --type ios --username "mobile@privado.io" --password "$K8S_SECRET_NOTARIZATION" --file $IPA_PATH/PROD/PrivadoVPN.ipa if [ "$?" != "0" ]; then echo >&2 "Error ⛔️ upload PRODUCTION failed"; exit 1 fi xcrun altool --upload-app --type ios --username "mobile@privado.io" --password "$K8S_SECRET_NOTARIZATION" --file $IPA_PATH/BETA/PrivadoVPN.ipa if [ "$?" != "0" ]; then echo >&2 "Error ⛔️ upload BETA failed"; exit 1 fi fi