From 54b255aec1ad906368783836b22c18ff90981526 Mon Sep 17 00:00:00 2001 From: Toni Sevener Date: Mon, 9 Oct 2023 10:49:12 -0500 Subject: [PATCH] Remove merchant ID injection scripts --- ci_scripts/ci_pre_xcodebuild.sh | 15 ------- ci_scripts/copy_environment_vars.sh | 54 ------------------------ scripts/copy_staging_environment_vars.sh | 21 --------- 3 files changed, 90 deletions(-) delete mode 100755 ci_scripts/copy_environment_vars.sh delete mode 100755 scripts/copy_staging_environment_vars.sh diff --git a/ci_scripts/ci_pre_xcodebuild.sh b/ci_scripts/ci_pre_xcodebuild.sh index 388b2fb8f59..f431e91ca75 100755 --- a/ci_scripts/ci_pre_xcodebuild.sh +++ b/ci_scripts/ci_pre_xcodebuild.sh @@ -10,19 +10,4 @@ if [[ ${CI_WORKFLOW} == "Run Tests" ]]; then exit 0 fi -EntitlementsFile="${CI_PRIMARY_REPOSITORY_PATH}/Wikipedia/Wikipedia.entitlements" - -if [[ ${CI_WORKFLOW} == "Weekly Staging Build" ]]; then - InfoPListFile="${CI_PRIMARY_REPOSITORY_PATH}/Wikipedia/Staging-Info.plist" - ./copy_environment_vars.sh $EntitlementsFile $InfoPListFile $MERCHANT_ID - echo "Execute copy merchant IDs." - exit 0 - -elif [[ ${CI_WORKFLOW} == "Nightly Build" ]]; then - InfoPListFile="${CI_PRIMARY_REPOSITORY_PATH}/Wikipedia/Wikipedia-Info.plist" - ./copy_environment_vars.sh $EntitlementsFile $InfoPListFile $MERCHANT_ID -fi - - - exit 0 diff --git a/ci_scripts/copy_environment_vars.sh b/ci_scripts/copy_environment_vars.sh deleted file mode 100755 index 36ffb109080..00000000000 --- a/ci_scripts/copy_environment_vars.sh +++ /dev/null @@ -1,54 +0,0 @@ -if [ $# -eq 0 ]; -then - echo "$0: Missing arguments" - exit 1 -elif [ $# -gt 3 ]; -then - echo "$0: Too many arguments: $@" - exit 1 -fi - -EntitlementsFile=$1 -InfoPListFile=$2 -MerchantID=$3 - -echo "\n\n------Valid Parameters:------" - -echo $EntitlementsFile -echo $InfoPListFile -echo $MerchantID - -if [ ! -f "$EntitlementsFile" ]; then - echo "Unable to find Entitlements file to update." - exit 1 -fi - -if [ ! -f "$InfoPListFile" ]; then - echo "Unable to find InfoPList file to update." - exit 1 -fi - -if [ -z "$MerchantID" ]; then - echo "MerchantID missing." - exit 1 -fi - -echo "\n\n------Update MerchantID in Entitlements file------" - -existingEntitlementsMerchantID=$(/usr/libexec/PlistBuddy -c "Print com.apple.developer.in-app-payments:0" "$EntitlementsFile") -echo "Existing EntitlementsFile MerchantID: $existingEntitlementsMerchantID" -if [ -z "$existingEntitlementsMerchantID" ]; then - /usr/libexec/PlistBuddy -c "Add :com.apple.developer.in-app-payments: string '$MerchantID'" "$EntitlementsFile" - newEntitlementsMerchantID=$(/usr/libexec/PlistBuddy -c "Print com.apple.developer.in-app-payments:0" "$EntitlementsFile") - echo "Added EntitlementsFile MerchantID: $newEntitlementsMerchantID" -fi - -echo "\n\n------Update MerchantID in Info.plist file------" - -existingInfoPlistMerchantID=$(/usr/libexec/PlistBuddy -c "Print MerchantID" "$InfoPListFile") -echo "Existing InfoPListFile MerchantID: $existingInfoPlistMerchantID" -if [ -z "$existingInfoPlistMerchantID" ]; then - /usr/libexec/PlistBuddy -c "Add MerchantID string '$MerchantID'" "$InfoPListFile" - newInfoPlistMerchantID=$(/usr/libexec/PlistBuddy -c "Print MerchantID" "$InfoPListFile") - echo "Added InfoPListFile MerchantID: $newInfoPlistMerchantID" -fi diff --git a/scripts/copy_staging_environment_vars.sh b/scripts/copy_staging_environment_vars.sh deleted file mode 100755 index c5c9d774cfc..00000000000 --- a/scripts/copy_staging_environment_vars.sh +++ /dev/null @@ -1,21 +0,0 @@ -# This mimics the script that Xcode Cloud will call for the Staging and Production builds. It will pass in the proper environment variable parameters to copy_environment_vars.sh (see ci-scripts/ci_pre_xcodebuild.sh). -# Use this script for locally populating the entitlements and Info.plist files with Merchant IDs, API Keys, etc. -# From root directory, call with: -# ./scripts/copy_staging_environment_vars.sh "{merchant-ID-here}" -# Do not commit the changes this script causes. - -if [ $# -eq 0 ]; -then - echo "$0: Missing arguments" - exit 1 -elif [ $# -gt 2 ]; -then - echo "$0: Too many arguments: $@" - exit 1 -fi - -EntitlementsFile="Wikipedia/Wikipedia.entitlements" -InfoPListFile="Wikipedia/Staging-Info.plist" -MerchantID=$1 - -./ci_scripts/copy_environment_vars.sh $EntitlementsFile $InfoPListFile $MerchantID