bitrise-steplib / steps-ios-auto-provision-appstoreconnect

MIT License
15 stars 16 forks source link

Support variable in iCloud Container #33

Closed lpusok closed 3 years ago

lpusok commented 3 years ago

https://bitrise.atlassian.net/browse/STEP-260

iCloud container name can contain variables, for example: iCloud.$(CFBundleIdentifier). The code checks if project entitlements mapped to a capability are present in the App ID on Developer Portal. The iCloud containers are a special case, where the exact container is checked for existence in the App ID. If does not exist, the autoprov step fails as can not create iCloud containers at the moment.

I only expand this specific variable (CFBundleIdentifier) for now. Also if the profile is not valid because of missing iCloud container, now will not fail, but will regenerate the profile.

Added additional logging of the reason if the profile needs to be regenerated, as there were multiple issues with it recently:

Example entitlements file for reference:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>aps-environment</key>
    <string>development</string>
    <key>com.apple.developer.applesignin</key>
    <array>
        <string>Default</string>
    </array>
    <key>com.apple.developer.icloud-container-identifiers</key>
    <array>
        <string>iCloud.${CFBundleIdentifier}</string>
    </array>
    <key>com.apple.developer.icloud-services</key>
    <array>
        <string>CloudKit</string>
    </array>
</dict>
</plist>