fastlane-old / sigh

Because you would rather spend your time building stuff than fighting provisioning
https://fastlane.tools
958 stars 86 forks source link

[Needs more testing] Added support for passing multiple app identifiers to sigh #247

Closed KrauseFx closed 8 years ago

KrauseFx commented 8 years ago

You can now run

sigh -a tools.fastlane.app

or

sigh -s tools.fastlane.app,tools.fastlane.sleepy
jaleksynas commented 8 years ago
  1. --filename; it is likely that specifying the filename will result in repeated overwriting of the file. I personally use specific file names and the the update_project_provisioning action to make use of the downloaded profiles explicitly by name.
  2. return values; examples (for example, https://github.com/fastlane/examples/blob/master/MindNode/Fastfile) will have trouble using this as sigh will only return a single/first UDID. I believe simplifying this repetitive usage is the main reason for the change, especially as apps continue to add extensions.

This may get more complex when handling the possible permutations, perhaps...

At the command line; it may be necessary to build in output (via ENV) controls array. E.g. --output_env_vars PROFILE_UDID,WATCHEXT_UDID,TODAYEXT_UDID There are some dangers here, like using PATH or other sensitive ENV variables.

In Fastfile however, something more explicitly grouped would be clearer, not sure how this could be done with command-line. It seems somewhat like deliver's metadata in some ways though.

Very Configurable.

A bunch of plural arguments :dizzy_face:....

sigh (
    app_identifiers: "app.one, app.two, app.three",
    filenames: "one.mobileprovision, two.mobileprovision, three.mobileprovision"
    output_env_vars: "ONE_UDID, TWO_UDID, THREE_UDID"
)

Maybe something like :neutral_face:...

sigh (
    output_path: "/tmp",
    app_identifiers: [
        {
          app_identifier: 'app.one',
          filename: 'one.mobileprovision',
          output_env_var: 'ONE_UDID'
        },
        {
          app_identifier: 'app.two',
          filename: 'two.mobileprovision',
          output_env_var: 'TWO_UDID'
        },
        {
          app_identifier: 'app.three',
          filename: 'three.mobileprovision',
          output_env_var: 'THREE_UDID'
        }
    ]
)

Either results in...

/tmp/one.mobileprovision
/tmp/two.mobileprovision
/tmp/three.mobileprovision

and

ENV['SIGH_ONE_UDID'] = <app.one UDID>
ENV['SIGH_TWO_UDID'] = <app.two UDID>
ENV['SIGH_THREE_UDID'] = <app.three UDID>
ENV['ONE_UDID'] = <app.one UDID>
ENV['TWO_UDID'] = <app.two UDID>
ENV['THREE_UDID'] = <app.three UDID>

Purely by convention :+1:...

sigh (
    output_path: "/tmp",
    app_identifiers: 'app.one, app.two, app.three',
    filename: "foo.mobileprovision" # ignored in multiple case
    filename_prefix: "foo_" # ignored in singleton case
)

Results in...

/tmp/foo_app_one.mobileprovision
/tmp/foo_app_two.mobileprovision
/tmp/foo_app_three.mobileprovision

and

ENV['SIGH_APP_ONE_UDID'] = <app.one UDID>
ENV['SIGH_APP_TWO_UDID'] = <app.two UDID>
ENV['SIGH_APP_THREE_UDID'] = <app.three UDID>

Copy the values from conventional values as one sees fit...

ENV['PROFILE_UDID'] = ENV['SIGH_APP_ONE_UDID']
ENV['WATCHEXT_UDID'] = ENV['SIGH_APP_TWO_UDID']
ENV['TODAYEXT_UDID'] = ENV['SIGH_APP_THREE_UDID']
KrauseFx commented 8 years ago

When I saw https://twitter.com/crylico/status/693187080877391872 I thought, how about providing a separate sigh action that works with multiple app identifiers, something like

sigh_bulk(
    output_path: "/tmp",
    app_identifiers: [
        {
          app_identifier: 'app.one',
          filename: 'one.mobileprovision',
          output_env_var: 'ONE_UDID'
        },
        {
          app_identifier: 'app.two',
          filename: 'two.mobileprovision',
          output_env_var: 'TWO_UDID'
        },
        {
          app_identifier: 'app.three',
          filename: 'three.mobileprovision',
          output_env_var: 'THREE_UDID'
        }
    ]
)

this way, this is part of the fastlane action, that just iterates through it and doesn't require any change in the sigh gem itself.

crylico commented 8 years ago

I like this. It's useful both with and without --force :)

KrauseFx commented 8 years ago

Use the force

KrauseFx commented 8 years ago

Alright, those are all valid points, I'll close this PR for now due to its complexity