trapeze icon indicating copy to clipboard operation
trapeze copied to clipboard

Extend plist support with raw text or variables

Open reslear opened this issue 3 years ago • 2 comments
trafficstars

hi @mlynch thx for this https://github.com/ionic-team/trapeze/issues/52 ❤️

so i'm suggest add support use plist inlined source from variables:

for example we has:

GOOGLE_SERVICE_PLIST_RAW="<?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>CLIENT_ID</key> <string>3853.apps.googleusercontent.com</string> <key>REVERSED_CLIENT_ID</key> <string>com.googleusercontent.apps.38275659253</string> <key>API_KEY</key> <string>AIzaSyDAxktyU</string> <key>GCM_SENDER_ID</key> <string>3592535</string> <key>PLIST_VERSION</key> <string>1</string> <key>BUNDLE_ID</key> <string>com.app.app</string> <key>PROJECT_ID</key> <string>nomad-dev-01</string> <key>STORAGE_BUCKET</key> <string>dev.appspot.com</string> <key>IS_ADS_ENABLED</key> <false/> <key>IS_ANALYTICS_ENABLED</key> <false/> <key>IS_APPINVITE_ENABLED</key> <true/> <key>IS_GCM_ENABLED</key> <true/> <key>IS_SIGNIN_ENABLED</key> <true/> <key>GOOGLE_APP_ID</key> <string>1:\4efc2d2</string> </dict> </plist>" 
vars: 
  GOOGLE_SERVICE_PLIST_RAW:
plist:
          - replace: true
            file: GoogleService-Info.plist
            raw:  $GOOGLE_SERVICE_PLIST_RAW

add switch/case raw and write variable value in: https://github.com/ionic-team/trapeze/blob/c1c7c81a566fec0f327e63b55d811a1b1e5a32b0/packages/configure/src/operations/ios/plist.ts#L8-L10

reslear avatar Sep 27 '22 16:09 reslear

Is there a reason you need to fill the GoogleService-Info.plist from a variable instead of using the copy operation to add the file? We had the same issue with that file and I described my workarounds at the time in https://github.com/ionic-team/trapeze/issues/94, but now that the copy operation is available, we just use the variables to inject paths to different GoogleService-Info.plist files for different environments and just copy the correct file. Screenshot 2022-09-29 at 14 44 20

Crylion avatar Sep 29 '22 12:09 Crylion

@Crylion

  1. we exclude additional writing of scripts sh
  2. exclude file hits for different environments [production, staging, development]
  3. the file is not stored in git
  4. all secret data is further stored in aws kms

reslear avatar Sep 29 '22 13:09 reslear

Ended up landing some support for this and will be in the next release after the holidays. Cheers

mlynch avatar Dec 22 '22 21:12 mlynch