{"action":"created","issue":{"url":"https://api.github.com/repos/fastlane/fastlane/issues/1423","repository_url":"https://api.github.com/repos/fastlane/fastlane","labels_url":"https://api.github.com/repos/fastlane/fastlane/issues/1423/labels{/name}","comments_url":"https://api.github.com/repos/fastlane/fastlane/issues/1423/comments","events_url":"https://api.github.com/repos/fastlane/fastlane/issues/1423/events","html_url":"https://github.com/fastlane/fastlane/issues/1423","id":136595856,"number":1423,"title":"Appfile rules don't apply if you switch lanes","user":{"login":"maxmeyers","id":344174,"avatar_url":"https://avatars.githubusercontent.com/u/344174?v=3","gravatar_id":"","url":"https://api.github.com/users/maxmeyers","html_url":"https://github.com/maxmeyers","followers_url":"https://api.github.com/users/maxmeyers/followers","following_url":"https://api.github.com/users/maxmeyers/following{/other_user}","gists_url":"https://api.github.com/users/maxmeyers/gists{/gist_id}","starred_url":"https://api.github.com/users/maxmeyers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxmeyers/subscriptions","organizations_url":"https://api.github.com/users/maxmeyers/orgs","repos_url":"https://api.github.com/users/maxmeyers/repos","events_url":"https://api.github.com/users/maxmeyers/events{/privacy}","received_events_url":"https://api.github.com/users/maxmeyers/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/fastlane/fastlane/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-26T04:41:47Z","updated_at":"2016-03-01T16:08:03Z","closed_at":null,"body":"I have a separate `team_id` set for a specific lane. It works great if I run the lane directly, but if I get to that lane from another lane, the Appfile is ignored.\r\n\r\nFor example, here's what the Appfile looks like:\r\n\r\n```\r\napp_identifier \"com.example.app\"\r\napple_id \"ios@example.com\"\r\nteam_id \"developer_team_id\"\r\n\r\nfor_platform :ios do\r\n  for_lane :beta do\r\n    app_identifier \"com.example.beta.app\"\r\n    team_id \"enterprise_team_id\"\r\n  end\r\nend\r\n```\r\n\r\nAnd the entry lane:\r\n```\r\n  lane :nightly do\r\n    increment_build_number\r\n    beta\r\n    adhoc\r\n  end\r\n```\r\n\r\nIf you run `sigh` from within the `beta` lane, it will still be using the default `app_identifier` and `team_id`."},"comment":{"url":"https://api.github.com/repos/fastlane/fastlane/issues/comments/190786727","html_url":"https://github.com/fastlane/fastlane/issues/1423#issuecomment-190786727","issue_url":"https://api.github.com/repos/fastlane/fastlane/issues/1423","id":190786727,"user":{"login":"mccarron","id":45654,"avatar_url":"https://avatars.githubusercontent.com/u/45654?v=3","gravatar_id":"","url":"https://api.github.com/users/mccarron","html_url":"https://github.com/mccarron","followers_url":"https://api.github.com/users/mccarron/followers","following_url":"https://api.github.com/users/mccarron/following{/other_user}","gists_url":"https://api.github.com/users/mccarron/gists{/gist_id}","starred_url":"https://api.github.com/users/mccarron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mccarron/subscriptions","organizations_url":"https://api.github.com/users/mccarron/orgs","repos_url":"https://api.github.com/users/mccarron/repos","events_url":"https://api.github.com/users/mccarron/events{/privacy}","received_events_url":"https://api.github.com/users/mccarron/received_events","type":"User","site_admin":false},"created_at":"2016-03-01T16:08:03Z","updated_at":"2016-03-01T16:08:03Z","body":"We noticed this too, because of how we configure Fastlane with Circle CI we start on one lane and change the lane based on various things. The Appfile is only processed the first run and not after lanes are changed.\r\n\r\nWe do lane changes in the Fastfile because of how Circle does Tests and builds to reduce the amount of time the build takes by going with Fastlane only. So we fire off fastlane on the `circle` lane. \r\n\r\nHere's the logic we use for that if that helps:\r\n```\r\nlane :circle do\r\n    if is_ci\r\n      if ENV['CIRCLE_BRANCH'] == 'master'\r\n        beta\r\n      elsif ENV['CIRCLE_BRANCH'] == 'deployed'\r\n        production\r\n      else \r\n        justbuild\r\n      end\r\n    else\r\n        puts \"Run this lane on Circle CI only\"\r\n    end\r\n  end\r\n```\r\n"}}