fastlane-old / spaceship Goto Github PK
View Code? Open in Web Editor NEWRuby library to access the Apple Dev Center and iTunes Connect
Home Page: https://spaceship.airforce
Ruby library to access the Apple Dev Center and iTunes Connect
Home Page: https://spaceship.airforce
@snatchev could you document the Base
class and its methods?
Am I writing a new Gem to use this tool it looks like? as nothing seem to happen with I use it in irb
as I try using the "irb"
and I enter in the
require "spaceship".
then I try
following you steps
of login
Spaceship.login("[email protected]", "password") of course I enter in valid info
and then tried to add a new device to license
I get new device added to license and no error is display
all_devices = Spaceship.device.all
Spaceship.device.create!(name: "Private iPhone 6", udid: "5814abb3...") of course I enter in valid info
there is no feedback to know if I doing this right
I like to try using this but I am not getting anywhere with it
I am looking at adding this to the API.
There's a field contentProvider under https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/ra/user/detail but it is already set even if you have no app created. ITC isn't using it to prefill the form either:
Given that this parameter is to be used once only, I am not sure if I should modify client.create_application() (and add a default nil parameter) or find a better way to provide it (e.g. client.company_name). Not happy of that field either, because it would have strange reading/setting semantics. I suspect adding the parameter to create_application is better. Feedback ?
I think it makes sense to provide the most common helper methods:
Instead of
prod_push_certs = Spaceship.certificates.select {|c| c.kind_of?(Spaceship::Certificates::ProductionPush) }
use
prod_push_certs = Spaceship.certificates.all_of_type(Spaceship::Certificates::ProductionPush)
What do you think?
With methods like provisioning_profiles.create
it should be possible to use named parameters I think.
Instead of
def create(klass, name, bundle_id, certificate, devices = nil)
def create(klass: nil, name: nil, bundle_id: nil, certificate: nil, devices: nil)
and then we can call it using
Spaceship.provisioning_profiles.create(
klass: Spaceship::ProvisioningProfiles::Development,
name: "Spaceship",
bundle_id: "net.sunapps.1",
certificate: Spaceship.certificates.all_of_type(Spaceship::Certificates::Development).first,
devices: [Spaceship.devices.first]
)
What do you think?
Fastlane fails every time when fetching provisioning profiles. This happens on all dev machines, but not on our Jenkins build server. The trace is always the same:
[16:46:30]: Successfully loaded custom action '/Users/<...>/fastlane/actions/fetch_assets.rb'.
[16:46:30]: Driving the lane 'release'
[16:46:30]: -------------------------------------
[16:46:30]: --- Step: ensure_git_status_clean ---
[16:46:30]: -------------------------------------
[16:46:30]: Git status is clean, all good!
[16:46:30]: ------------------
[16:46:30]: --- Step: sigh ---
[16:46:30]: ------------------
[16:46:30]: Starting login
Logging spaceship web requests to '/tmp/spaceship.log'
[16:46:33]: Successfully logged in
[16:46:35]: -------------------
[16:46:35]: --- Step: slack ---
[16:46:35]: -------------------
[16:46:35]: Successfully sent Slack notification
[16:46:35]: Variable Dump:
[16:46:35]: {:ENVIRONMENT=>nil, :PLATFORM_NAME=>nil, :LANE_NAME=>"release", :GIT_REPO_WAS_CLEAN_ON_START=>true}
[16:46:35]: invalid codepoint 0xD83D in UTF-8
[16:46:36]: fastlane finished with errors
/usr/local/var/rbenv/versions/2.1.2/lib/ruby/2.1.0/cgi/util.rb:73:in `chr': invalid codepoint 0xD83D in UTF-8 (Faraday::ParsingError)
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/2.1.0/cgi/util.rb:73:in `block in unescapeHTML'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/2.1.0/cgi/util.rb:60:in `gsub'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/2.1.0/cgi/util.rb:60:in `unescapeHTML'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/plist-3.1.0/lib/plist/parser.rb:167:in `to_ruby'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/plist-3.1.0/lib/plist/parser.rb:150:in `block in to_ruby'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/plist-3.1.0/lib/plist/parser.rb:146:in `each'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/plist-3.1.0/lib/plist/parser.rb:146:in `to_ruby'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/plist-3.1.0/lib/plist/parser.rb:174:in `block in to_ruby'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/plist-3.1.0/lib/plist/parser.rb:173:in `collect'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/plist-3.1.0/lib/plist/parser.rb:173:in `to_ruby'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/plist-3.1.0/lib/plist/parser.rb:150:in `block in to_ruby'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/plist-3.1.0/lib/plist/parser.rb:146:in `each'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/plist-3.1.0/lib/plist/parser.rb:146:in `to_ruby'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/plist-3.1.0/lib/plist/parser.rb:174:in `block in to_ruby'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/plist-3.1.0/lib/plist/parser.rb:173:in `collect'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/plist-3.1.0/lib/plist/parser.rb:173:in `to_ruby'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/plist-3.1.0/lib/plist/parser.rb:150:in `block in to_ruby'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/plist-3.1.0/lib/plist/parser.rb:146:in `each'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/plist-3.1.0/lib/plist/parser.rb:146:in `to_ruby'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/plist-3.1.0/lib/plist/parser.rb:137:in `to_ruby'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/plist-3.1.0/lib/plist/parser.rb:55:in `tag_end'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/plist-3.1.0/lib/plist/parser.rb:103:in `parse'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/plist-3.1.0/lib/plist/parser.rb:29:in `parse_xml'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spaceship-0.0.11/lib/spaceship/helper/plist_middleware.rb:16:in `block in <class:PlistMiddleware>'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/faraday_middleware-0.9.1/lib/faraday_middleware/response_middleware.rb:48:in `call'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/faraday_middleware-0.9.1/lib/faraday_middleware/response_middleware.rb:48:in `parse'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/faraday_middleware-0.9.1/lib/faraday_middleware/response_middleware.rb:39:in `process_response'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/faraday_middleware-0.9.1/lib/faraday_middleware/response_middleware.rb:32:in `block in call'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/faraday-0.9.1/lib/faraday/response.rb:57:in `on_complete'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/faraday_middleware-0.9.1/lib/faraday_middleware/response_middleware.rb:30:in `call'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/faraday_middleware-0.9.1/lib/faraday_middleware/response_middleware.rb:30:in `call'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/faraday_middleware-0.9.1/lib/faraday_middleware/response_middleware.rb:30:in `call'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/faraday-0.9.1/lib/faraday/rack_builder.rb:139:in `build_response'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/faraday-0.9.1/lib/faraday/connection.rb:377:in `run_request'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/faraday-0.9.1/lib/faraday/connection.rb:177:in `post'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spaceship-0.0.11/lib/spaceship/client.rb:469:in `send_request'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spaceship-0.0.11/lib/spaceship/client.rb:444:in `request'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spaceship-0.0.11/lib/spaceship/client.rb:358:in `provisioning_profiles'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spaceship-0.0.11/lib/spaceship/provisioning_profile.rb:224:in `all'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/spaceship-0.0.11/lib/spaceship/provisioning_profile.rb:245:in `find_by_bundle_id'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/sigh-1.0.0.beta6/lib/sigh/spaceship/runner.rb:57:in `fetch_profiles'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/sigh-1.0.0.beta6/lib/sigh/spaceship/runner.rb:15:in `run'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/sigh-1.0.0.beta6/lib/sigh/manager.rb:8:in `start'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-1.7.0/lib/fastlane/actions/sigh.rb:20:in `run'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-1.7.0/lib/fastlane/fast_file.rb:112:in `block (2 levels) in method_missing'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-1.7.0/lib/fastlane/actions/actions_helper.rb:51:in `execute_action'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-1.7.0/lib/fastlane/fast_file.rb:94:in `block in method_missing'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-1.7.0/lib/fastlane/fast_file.rb:93:in `chdir'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-1.7.0/lib/fastlane/fast_file.rb:93:in `method_missing'
from (eval):202:in `block (2 levels) in parse'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-1.7.0/lib/fastlane/runner.rb:39:in `call'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-1.7.0/lib/fastlane/runner.rb:39:in `block in execute'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-1.7.0/lib/fastlane/runner.rb:29:in `chdir'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-1.7.0/lib/fastlane/runner.rb:29:in `execute'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-1.7.0/lib/fastlane/lane_manager.rb:33:in `cruise_lane'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-1.7.0/bin/fastlane:39:in `block (2 levels) in run'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/commander-4.3.4/lib/commander/command.rb:178:in `call'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/commander-4.3.4/lib/commander/command.rb:178:in `call'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/commander-4.3.4/lib/commander/command.rb:153:in `run'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/commander-4.3.4/lib/commander/runner.rb:428:in `run_active_command'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/commander-4.3.4/lib/commander/runner.rb:68:in `run!'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/commander-4.3.4/lib/commander/delegates.rb:15:in `run!'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-1.7.0/bin/fastlane:128:in `run'
from /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/fastlane-1.7.0/bin/fastlane:134:in `<top (required)>'
from /usr/local/var/rbenv/versions/2.1.2/bin/fastlane:23:in `load'
from /usr/local/var/rbenv/versions/2.1.2/bin/fastlane:23:in `<main>'
from /usr/local/var/rbenv/versions/2.1.2/bin/ruby_executable_hooks:15:in `eval'
from /usr/local/var/rbenv/versions/2.1.2/bin/ruby_executable_hooks:15:in `<main>'
The relevant section from Fastfile
is:
lane :release do
ensure_git_status_clean
# Download AdHoc provisioning profile
sigh({
adhoc: true,
app_identifier: bundle_identifier(beta = false)
})
<...>
spaceship.log
shows this:
[16:52:17]: POST: https://idmsa.apple.com/IDMSWebAuth/authenticate {appleId: <redacted>}, {appIdKey:<redacted>}
[16:52:18]: POST: https://idmsa.apple.com/IDMSWebAuth/authenticate:
[16:52:18]: POST: account/listTeams.action
[16:52:19]: POST: account/listTeams.action: {"creationTimestamp"=>"2015-07-10T13:52:16Z", "resultCode"=>0, "userLocale"=>"en_US", "protocolVersion"=>"QH65B2", "requestId"=>nil, "requestUrl"=>"https://developer.apple.com:443//services-account/QH65B2/account/listTeams.action", "responseId"=>"5e738566-50d6-4729-88fe-9925da294fa0", "isAdmin"=>nil, "isMember"=>nil, "isAgent"=>nil, "pageNumber"=>nil, "pageSize"=>nil, "totalRecords"=>nil, "httpResponseHeaders"=>nil, "teams"=><redacted>}
[16:52:19]: POST:
I've managed to track the error to the malformed XML coming from not completely sure where. It contains the following block which seems to crash plist-3.1.0 and shows parsing error when checked with http://www.w3schools.com/dom/dom_validate.asp.
The offending section is:
<dict>
<key>name</key>
<string>iOS Development: ��</string>
<key>certificateId</key>
<string>*redacted*</string>
<key>serialNumber</key>
<string>*redacted*</string>
<key>status</key>
<string>Issued</string>
<key>statusCode</key>
<integer>0</integer>
<key>expirationDate</key>
<date>2016-04-16T11:46:06Z</date>
<key>certificatePlatform</key>
<string>ios</string>
<key>certificateType</key>
<dict>
<key>certificateTypeDisplayId</key>
<string>*redacted*</string>
<key>name</key>
<string>iOS Development</string>
<key>platform</key>
<string>ios</string>
<key>permissionType</key>
<string>development</string>
<key>distributionType</key>
<string>development</string>
<key>distributionMethod</key>
<string>app</string>
<key>ownerType</key>
<string>teamMember</string>
<key>daysOverlap</key>
<integer>364</integer>
<key>maxActive</key>
<integer>1</integer>
</dict>
</dict>
Might be related to a fact that I have my development device name set to เทดเทด
:)
Not sure if that is even fixable on the lib side, seems to be like an invalid response coming from iTunesConnect servers...
via irb
I run:
require "spaceship"
Spaceship.login("[email protected]",'myvalidpw')
At this point I get what looks to be a valid cookie to stdout. When I then run Spaceship.select_team
I get:
Spaceship::Client::UnexpectedResponse: {"creationTimestamp"=>"2015-07-08T20:30:08Z", "resultCode"=>0, "userLocale"=>"en_US", "protocolVersion"=>"QH65B2", "requestId"=>nil, "requestUrl"=>"https://developer.apple.com:443//services-account/QH65B2/account/listTeams.action", "responseId"=>"458bc370-1676-40a9-bc06-9394af801969", "isAdmin"=>nil, "isMember"=>nil, "isAgent"=>nil, "pageNumber"=>nil, "pageSize"=>nil, "totalRecords"=>nil, "httpResponseHeaders"=>nil}
from /Users/ryan/.rvm/gems/ruby-2.2.2@global/gems/spaceship-0.0.14/lib/spaceship/client.rb:498:in `parse_response'
from /Users/ryan/.rvm/gems/ruby-2.2.2@global/gems/spaceship-0.0.14/lib/spaceship/client.rb:188:in `teams'
from /Users/ryan/.rvm/gems/ruby-2.2.2@global/gems/spaceship-0.0.14/lib/spaceship/ui/select_team.rb:35:in `select_team'
from /Users/ryan/.rvm/gems/ruby-2.2.2@global/gems/spaceship-0.0.14/lib/spaceship/client.rb:204:in `select_team'
from /Users/ryan/.rvm/gems/ruby-2.2.2@global/gems/spaceship-0.0.14/lib/spaceship.rb:46:in `select_team'
from (irb):3
from /Users/ryan/.rvm/rubies/ruby-2.2.2/bin/irb:11:in `<main>'
I get this Spaceship::Client::UnexpectedResponse
on any method I call (all_apps = Spaceship.app.all
) etc. Any ideas?
Using ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
I also saw in a closed issue there is some verbose logging to see the HTTP request and response going over the wire - how do I enable that from irb
?
The Xcode API doesn't list invalid provisioning profiles
While the Dev Portal API does:
{
"provisioningProfileId": "ZK88LXD65A",
"name": "net.sunapps.151 AppStore",
"status": "Invalid",
"type": "iOS Distribution",
"distributionMethod": "store",
"proProPlatform": "ios",
"version": "2",
"dateExpire": "2016-02-10",
"managingApp": null,
"deviceIds": [],
"certificateIds": [],
"UUID": "e62f6893-4e4a-4cfa-9ce1-0be7ca4671cf"
},
We could go ahead provide a list of invalid
provisioning profiles (a separate subclass) that can be used to make sure a name is not taken yet. Besides a name, the other thing this might be useful for: Repairing existing provisioning profiles instead of always creating new ones.
Installed via gem
and also tried the latest development version using sudo bundle install && sudo rake install
on my local git repo. Install goes through fine, but I get the following error when trying to require
it:
irb(main):001:0> require 'Spaceship'
SyntaxError: /Library/Ruby/Gems/2.0.0/gems/spaceship-0.1.2/lib/spaceship/certificate.rb:156: syntax error, unexpected keyword_end, expecting end-of-input
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:73:in `require'
from /Library/Ruby/Gems/2.0.0/gems/spaceship-0.1.2/lib/Spaceship.rb:7:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:in `require'
from (irb):1
from /usr/bin/irb:12:in `<main>'
irb(main):002:0>
What do you prefer?
Spaceship.apps.find('net.sunapps.4').delete
or
Spaceship.apps.delete('net.sunapps.4')
the first thing would allow things like
a = Spaceship.apps.find('net.sunapps.4')
if a.something == 'asdf'
a.delete
end
I think calling .delete
or .download
on the profile/certificate/app directly makes much more sense. Can I refactor this?
Spaceship.login
app = Spaceship.apps.create!(identifier: โcom.krausefx.appโ, name: โNew Appโ)
profile = app.provisioning_profiles.create!(
type: :appstore,
name: "Spaceship Profile"
)
profile.download
That would be super cool:
profile = app.provisioning_profiles.create!(...)
and maybe to Portal as well. See discussion in #69
I can't seem to make the Spaceship.provisioning_profile work they just seem to hang and never return.
I do have large account with a lots of provision profiles I will try this on a smaller account.
profiles = Spaceship.provisioning_profile.all
profiles_appstore = Spaceship.provisioning_profile.app_store.all
profiles_adhoc = Spaceship.provisioning_profile.ad_hoc.all
profiles_dev = Spaceship.provisioning_profile.development.all
filtered_profiles = Spaceship.provisioning_profile.app_store.find_by_bundle_id("com.krausefx.app")
By the way thank you for figuring this out.
Currently we're just taking the first team
def team_id
@current_team_id ||= teams[0]['teamId']
end
It is really important to ask the user. I already got some code in fastlane_core
I can integrate.
When executing Spaceship.provisioning_profiles
it takes about a second to load. Does that send a request every time we call this method? If so, shouldn't we cache it locally and only clear the cache when we modify the profiles?
owner_name
owner_id
@snatchev They are always nil for me, am I missing something?
We've had a brief discussion on the Slack channel about adding iTunes Connect support to Spaceship. While we are still undecided on architecture/implementation, I think we can all agree that this is of real importance to the library. The only issues that occur when I use Fastlane
is with iTunes Connect calls.
This ticket is to act as a place of discussion for the architecture and implementation of iTunes Connect's API into Spaceship
๐.
To get the ball rolling, I have some thoughts about the structure. It would be neat if the interface for Spaceship
didn't change at all. So calling login
would log me into the provisioning portal and iTunes Connect. Similarly, Spaceship.app.create
would create a new application on both the Prov Portal and iTunes Connect, etc.
We would then simply need to extend Spaceship's interface to do iTunes Connect specific tasks if we needed that.
Plenty more discussion to be had around this. Very excited to get this underway!
e.g. .create!
instead of .create
I probably do something wrong:
Spaceship.provisioning_profiles.create(
klass: Spaceship::ProvisioningProfiles::Development,
name: "Spaceship",
bundle_id: "net.sunapps.1",
certificate: Spaceship.certificates.all_of_type(Spaceship::Certificates::Development).first,
devices: [Spaceship.devices.first]
)
and receive:
Spaceship::Client::UnexpectedResponse: {"responseId"=>"1786cf07-b77e-4176-a164-33029122a54b", "resultCode"=>35, "resultString"=>"There were errors in the data supplied. Please correct and re-submit.", "userString"=>"There are no current devices on this team matching the provided device IDs.", "creationTimestamp"=>"2015-05-13T21:15:47Z", "protocolVersion"=>"QH65B2", "requestId"=>nil, "userLocale"=>"en_US", "requestUrl"=>"https://developer.apple.com/services-account/QH65B2/account/ios/profile/createProvisioningProfile.action", "httpCode"=>200, "validationMessages"=>[{"validationKey"=>"deviceIds", "validationUserMessage"=>"There are no current devices on this team matching the provided device IDs."}]}
from /Users/felixkrause/Downloads/spaceship_neu/spaceship/lib/spaceship/client.rb:263:in `parse_response'
When I do Spaceship.provisioning_profile.all it only returns AppStore profiles.
Spaceship.provisioning_profile.development returns an empty array. I know I have wildcard dev profiles.
I haven't quite yet understood the complete structure, but it seems like Spaceship.something
uses a singleton. It is important to be able to maintain multiple instances of Spaceship
. Is that possible right now?
Hello. The same issue like in pem: fastlane-old/pem#53
I've realised that issue for me, but this tool works much faster. So I've tried to do the same:
csr, pkey = Spaceship.certificate.create_certificate_signing_request
Spaceship.certificate.production_push.create!(csr: csr, bundle_id: "bundleid")
Everything OK.
But when I try to do the same with created files there is something wrong:
Spaceship.certificate.production_push.create!(csr: csr, bundle_id: "bundleid")
irb output here:
push.rb(main):012:0* Spaceship.certificate.production_push.create!(csr: csr, bundle_id: "bundleid")push.rb(main):012:0*
push.rb(main):012:0>
NoMethodError: undefined method `to_pem' for #<String:0x007fe1142646f0>
from /Library/Ruby/Gems/2.0.0/gems/spaceship-0.0.8/lib/spaceship/certificate.rb:239:in `create!'
from push.rb:12
from /usr/bin/irb:12:in `<main>'
I tried using
csr = Spaceship::Certificate.certificate_signing_request
Spaceship::Certificate::ProductionPush.create!(csr, "com.krausefx.app")
NoMethodError: undefined method `to_pem' for #<Array:0x007fd94be3f6f8>
from /Users/felixkrause/Developer/fastlane/spaceship/lib/spaceship/certificate.rb:122:in `create!'
from (irb):21
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.9.9/lib/bundler/cli/console.rb:14:in `run'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.9.9/lib/bundler/cli.rb:298:in `console'
from /Library/Ruby/Gems/2.0.0/gems/bundler-1.9.9/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
Need to test if that's working already. It's probably another type we need to add.
It looks like the type is hardcoded ?appType=ios
Right now in the client.rb
file, we make a network request, and then parse the response. However, instead of passing in the received response, we store the value as a variable on the class, which means that in a multi threaded environment this could produce interesting/bad results.
I think instead we should allow the requesting method to pass a callback block into the request
method that will give the last response to the parse_response
method, or perhaps even pass the parse key into a new request_and_parse
method for simplicity at the callsite as everyone will need this.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/protocol.rb:158:in `rescue in rbuf_fill': Net::ReadTimeout (Faraday::TimeoutError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/protocol.rb:152:in `rbuf_fill'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/protocol.rb:134:in `readuntil'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/protocol.rb:144:in `readline'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/response.rb:39:in `read_status_line'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http/response.rb:28:in `read_new'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:1406:in `block in transport_request'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:1403:in `catch'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:1403:in `transport_request'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:1376:in `request'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:1369:in `block in request'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:852:in `start'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/net/http.rb:1367:in `request'
from /Library/Ruby/Gems/2.0.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:82:in `perform_request'
from /Library/Ruby/Gems/2.0.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:40:in `block in call'
from /Library/Ruby/Gems/2.0.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:87:in `with_net_http_connection'
from /Library/Ruby/Gems/2.0.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:32:in `call'
from /Library/Ruby/Gems/2.0.0/gems/faraday_middleware-0.9.1/lib/faraday_middleware/response_middleware.rb:30:in `call'
from /Library/Ruby/Gems/2.0.0/gems/faraday_middleware-0.9.1/lib/faraday_middleware/response_middleware.rb:30:in `call'
from /Library/Ruby/Gems/2.0.0/gems/faraday_middleware-0.9.1/lib/faraday_middleware/response_middleware.rb:30:in `call'
from /Library/Ruby/Gems/2.0.0/gems/faraday-0.9.1/lib/faraday/rack_builder.rb:139:in `build_response'
from /Library/Ruby/Gems/2.0.0/gems/faraday-0.9.1/lib/faraday/connection.rb:377:in `run_request'
from /Library/Ruby/Gems/2.0.0/gems/faraday-0.9.1/lib/faraday/connection.rb:177:in `post'
from /Library/Ruby/Gems/2.0.0/gems/spaceship-0.1.2/lib/spaceship/client.rb:298:in `request'
from /Library/Ruby/Gems/2.0.0/gems/spaceship-0.1.2/lib/spaceship/client.rb:229:in `create_provisioning_profile!'
from /Library/Ruby/Gems/2.0.0/gems/spaceship-0.1.2/lib/spaceship/provisioning_profile.rb:65:in `create!'
from /Users/felixkrause/Developer/fastlane/sigh/lib/sigh/spaceship/runner.rb:81:in `create_profile!'
from /Users/felixkrause/Developer/fastlane/sigh/lib/sigh/spaceship/runner.rb:36:in `block in run'
from /Users/felixkrause/Developer/fastlane/sigh/lib/sigh/spaceship/runner.rb:35:in `times'
from /Users/felixkrause/Developer/fastlane/sigh/lib/sigh/spaceship/runner.rb:35:in `run'
from /Users/felixkrause/Developer/fastlane/sigh/lib/sigh/manager.rb:9:in `start'
from ./bin/sigh:36:in `block (2 levels) in run'
How should timeout be handled? How about we try it up to 3 times and then raise the exception?
This line is causing the exception when there is a timeout:
@client.send(method, url_or_path, params, headers, &block)
You can now just run yard
to generate a documentation in the ./doc
folder. This will also output the coverage of the documentation.
I think this can wait once we decided for all the bigger architectural decisions.
pry, proxy, etc.
Spaceship.provisioning_profiles.create!
NoMethodError: undefined method `create!' for #<Array:0x007fabcaad1d30>
from (irb):9
from /Users/felixkrause/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.9.6/lib/bundler/cli/console.rb:14:in `run'
from /Users/felixkrause/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.9.6/lib/bundler/cli.rb:300:in `console'
from /Users/felixkrause/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.9.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
from /Users/felixkrause/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.9.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
from /Users/felixkrause/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.9.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
from /Users/felixkrause/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.9.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
from /Users/felixkrause/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.9.6/lib/bundler/cli.rb:10:in `start'
from /Users/felixkrause/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.9.6/bin/bundle:20:in `block in <top (required)>'
from /Users/felixkrause/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.9.6/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
from /Users/felixkrause/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.9.6/bin/bundle:18:in `<top (required)>'
from /Users/felixkrause/.rvm/gems/ruby-2.0.0-p481@global/bin/bundle:23:in `load'
from /Users/felixkrause/.rvm/gems/ruby-2.0.0-p481@global/bin/bundle:23:in `<main>'
from /Users/felixkrause/.rvm/gems/ruby-2.0.0-p481/bin/ruby_executable_hooks:15:in `eval'
from /Users/felixkrause/.rvm
It's not frequent but now and then when running fastlane, specifically in my lane the first thing that runs is produce, I get an error (see below).
I've not found the cause of the error yet but some searching suggests that a misconfigured server can cause the problem. Other suggestions are that the SSL version needs to be specified (I think it's set on Net::HTTP that faraday uses).
I'll keep investigating and submit a pull request if I get anywhere. Just wanted to see if other people are experiencing the problem.
Thanks,
Greg
[16:11:33]: Variable Dump:
[16:11:33]: {:DEFAULT_PLATFORM=>:ios, :ENVIRONMENT=>nil, :PLATFORM_NAME=>:ios, :LANE_NAME=>"ios create_build"}
[16:11:33]: SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A
[16:11:34]: fastlane finished with errors
/usr/local/Cellar/ruby/2.2.0/lib/ruby/2.2.0/net/http.rb:923:in `connect': SSL_connect SYSCALL returned=5 errno=0 state=SSLv2/v3 read server hello A (Faraday::SSLError)
from /usr/local/Cellar/ruby/2.2.0/lib/ruby/2.2.0/net/http.rb:923:in `block in connect'
from /usr/local/Cellar/ruby/2.2.0/lib/ruby/2.2.0/timeout.rb:74:in `timeout'
from /usr/local/Cellar/ruby/2.2.0/lib/ruby/2.2.0/net/http.rb:923:in `connect'
from /usr/local/Cellar/ruby/2.2.0/lib/ruby/2.2.0/net/http.rb:863:in `do_start'
from /usr/local/Cellar/ruby/2.2.0/lib/ruby/2.2.0/net/http.rb:852:in `start'
from /usr/local/Cellar/ruby/2.2.0/lib/ruby/2.2.0/net/http.rb:1374:in `request'
from /usr/local/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:82:in `perform_request'
from /usr/local/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:40:in `block in call'
from /usr/local/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:87:in `with_net_http_connection'
from /usr/local/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/adapter/net_http.rb:32:in `call'
from /usr/local/lib/ruby/gems/2.2.0/gems/faraday_middleware-0.9.1/lib/faraday_middleware/response_middleware.rb:30:in `call'
from /usr/local/lib/ruby/gems/2.2.0/gems/faraday_middleware-0.9.1/lib/faraday_middleware/response_middleware.rb:30:in `call'
from /usr/local/lib/ruby/gems/2.2.0/gems/faraday_middleware-0.9.1/lib/faraday_middleware/response_middleware.rb:30:in `call'
from /usr/local/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/rack_builder.rb:139:in `build_response'
from /usr/local/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/connection.rb:377:in `run_request'
from /usr/local/lib/ruby/gems/2.2.0/gems/faraday-0.9.1/lib/faraday/connection.rb:177:in `post'
from /usr/local/lib/ruby/gems/2.2.0/gems/spaceship-0.0.11/lib/spaceship/client.rb:469:in `send_request'
from /usr/local/lib/ruby/gems/2.2.0/gems/spaceship-0.0.11/lib/spaceship/client.rb:444:in `request'
from /usr/local/lib/ruby/gems/2.2.0/gems/spaceship-0.0.11/lib/spaceship/client.rb:229:in `block in apps'
from /usr/local/lib/ruby/gems/2.2.0/gems/spaceship-0.0.11/lib/spaceship/client.rb:124:in `block in paging'
from /usr/local/lib/ruby/gems/2.2.0/gems/spaceship-0.0.11/lib/spaceship/client.rb:122:in `loop'
from /usr/local/lib/ruby/gems/2.2.0/gems/spaceship-0.0.11/lib/spaceship/client.rb:122:in `paging'
from /usr/local/lib/ruby/gems/2.2.0/gems/spaceship-0.0.11/lib/spaceship/client.rb:228:in `apps'
from /usr/local/lib/ruby/gems/2.2.0/gems/spaceship-0.0.11/lib/spaceship/app.rb:59:in `all'
from /usr/local/lib/ruby/gems/2.2.0/gems/spaceship-0.0.11/lib/spaceship/app.rb:82:in `find'
from /usr/local/lib/ruby/gems/2.2.0/gems/produce-0.3.1/lib/produce/developer_center.rb:46:in `app_exists?'
from /usr/local/lib/ruby/gems/2.2.0/gems/produce-0.3.1/lib/produce/developer_center.rb:16:in `create_new_app'
from /usr/local/lib/ruby/gems/2.2.0/gems/produce-0.3.1/lib/produce/developer_center.rb:10:in `run'
from /usr/local/lib/ruby/gems/2.2.0/gems/produce-0.3.1/lib/produce/manager.rb:7:in `start_producing'
from /usr/local/lib/ruby/gems/2.2.0/gems/fastlane-1.4.0/lib/fastlane/actions/produce.rb:28:in `block in run'
from /usr/local/lib/ruby/gems/2.2.0/gems/fastlane-1.4.0/lib/fastlane/actions/produce.rb:22:in `chdir'
from /usr/local/lib/ruby/gems/2.2.0/gems/fastlane-1.4.0/lib/fastlane/actions/produce.rb:22:in `run'
from /usr/local/lib/ruby/gems/2.2.0/gems/fastlane-1.4.0/lib/fastlane/fast_file.rb:112:in `block (2 levels) in method_missing'
from /usr/local/lib/ruby/gems/2.2.0/gems/fastlane-1.4.0/lib/fastlane/actions/actions_helper.rb:51:in `execute_action'
from /usr/local/lib/ruby/gems/2.2.0/gems/fastlane-1.4.0/lib/fastlane/fast_file.rb:94:in `block in method_missing'
from /usr/local/lib/ruby/gems/2.2.0/gems/fastlane-1.4.0/lib/fastlane/fast_file.rb:93:in `chdir'
from /usr/local/lib/ruby/gems/2.2.0/gems/fastlane-1.4.0/lib/fastlane/fast_file.rb:93:in `method_missing'
from (eval):239:in `produce_app_id'
from (eval):199:in `configure'
from (eval):180:in `block (3 levels) in parse'
from /usr/local/lib/ruby/gems/2.2.0/gems/fastlane-1.4.0/lib/fastlane/runner.rb:39:in `call'
from /usr/local/lib/ruby/gems/2.2.0/gems/fastlane-1.4.0/lib/fastlane/runner.rb:39:in `block in execute'
from /usr/local/lib/ruby/gems/2.2.0/gems/fastlane-1.4.0/lib/fastlane/runner.rb:29:in `chdir'
from /usr/local/lib/ruby/gems/2.2.0/gems/fastlane-1.4.0/lib/fastlane/runner.rb:29:in `execute'
from /usr/local/lib/ruby/gems/2.2.0/gems/fastlane-1.4.0/lib/fastlane/lane_manager.rb:33:in `cruise_lane'
from /usr/local/lib/ruby/gems/2.2.0/gems/fastlane-1.4.0/bin/fastlane:39:in `block (2 levels) in run'
from /usr/local/lib/ruby/gems/2.2.0/gems/commander-4.3.4/lib/commander/command.rb:178:in `call'
from /usr/local/lib/ruby/gems/2.2.0/gems/commander-4.3.4/lib/commander/command.rb:178:in `call'
from /usr/local/lib/ruby/gems/2.2.0/gems/commander-4.3.4/lib/commander/command.rb:153:in `run'
from /usr/local/lib/ruby/gems/2.2.0/gems/commander-4.3.4/lib/commander/runner.rb:428:in `run_active_command'
from /usr/local/lib/ruby/gems/2.2.0/gems/commander-4.3.4/lib/commander/runner.rb:68:in `run!'
from /usr/local/lib/ruby/gems/2.2.0/gems/commander-4.3.4/lib/commander/delegates.rb:15:in `run!'
from /usr/local/lib/ruby/gems/2.2.0/gems/fastlane-1.4.0/bin/fastlane:128:in `run'
from /usr/local/lib/ruby/gems/2.2.0/gems/fastlane-1.4.0/bin/fastlane:134:in `<top (required)>'
from /usr/local/bin/fastlane:23:in `load'
from /usr/local/bin/fastlane:23:in `<main>'
Not sure if that's already implemented
I'd like a verbose flag that shows the requests that are currently being sent.
e.g.
cert = Spaceship::Certificate::Production.all.first
profile = Spaceship::ProvisioningProfile::AppStore.create!(bundle_id: "notexistent",
certificate: cert)
I'll work on a great structure to make it immediately clear what spaceship
is and what it can do ๐
Taken from #58
iTunes Connect Features
Todos:
Portal
, Tunes
)reload
method to easily fetch the latest data for a given object (in particular for Spaceship::Tunes::Application
(@snatchev)Spaceship::Application.all
without logging inMZGenre.
before the category name (@snatchev)bundle console
, to not show garbageLater
After I changed my password, running fastlane always result in error:
[15:49:10]: fastlane finished with errors
/Users/siuying/.rvm/gems/ruby-2.1.5/gems/spaceship-0.0.14/lib/spaceship/client.rb:176:in `login': #<Faraday::Response:0x007fad7bb6d9d0> (Spaceship::Client::InvalidUserCredentialsError)
from /Users/siuying/.rvm/gems/ruby-2.1.5/gems/spaceship-0.0.14/lib/spaceship/client.rb:45:in `login'
from /Users/siuying/.rvm/gems/ruby-2.1.5/gems/spaceship-0.0.14/lib/spaceship.rb:31:in `login'
from /Users/siuying/.rvm/gems/ruby-2.1.5/gems/sigh-0.10.0/lib/sigh/spaceship/runner.rb:11:in `run'
from /Users/siuying/.rvm/gems/ruby-2.1.5/gems/sigh-0.10.0/lib/sigh/manager.rb:7:in `start'
from /Users/siuying/.rvm/gems/ruby-2.1.5/gems/fastlane-1.7.0/lib/fastlane/actions/sigh.rb:20:in `run'
I expect spaceship to ask me to enter new password, but it just crash.
Manually delete the entry 'fastlane." can workaround the issue.
Moved from: fastlane/fastlane#390
This shouldn't be necessary
profile.update!
profile = fetch_profiles.first # to have the latest profile information
profile = app.provisioning_profiles.create!(
type: :appstore,
name: "Spaceship Profile"
)
instead of
profile = app.provisioning_profiles.create!(
klass: Spaceship::ProvisioningProfiles::Development, # is okay, but too technical
name: "Spaceship Profile",
bundle_id: "net.sunapps.1", # not necessary when using `app.provisioning_profiles.create!`
certificate: Spaceship.certificates.all_of_type(Spaceship::Certificates::Development).first, # not necessary, choose the one that is installed locally and matched `development` or `distribution`
devices: Spaceship.devices # not necessary, all by default
)
I think providing a type
instead of a klass
is much more natural.
I don't think we need it @snatchev https://github.com/KrauseFx/spaceship/blob/master/lib/spaceship/profile_types.rb
Are you using it for anything?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.