Closed realf closed 8 years ago
The issue is present in spaceship-0.15.2 as well
Can you share your actions/update_apns_certificates
?
Hi @KrauseFx, In a nutshell this is what I have.
require "spaceship"
module Fastlane
module Actions
module SharedValues
UPDATE_APNS_CERTIFICATES_CUSTOM_VALUE = :UPDATE_APNS_CERTIFICATES_CUSTOM_VALUE
end
# To share this integration with the other fastlane users:
# - Fork https://github.com/KrauseFx/fastlane
# - Clone the forked repository
# - Move this integration into lib/fastlane/actions
# - Commit, push and submit the pull request
class UpdateApnsCertificatesAction < Action
def self.run(params)
# fastlane will take care of reading in the parameter and fetching the environment variable:
# Helper.log.info "Parameter API Token: #{params[:api_token]}"
# sh "shellcommand ./path"
# Actions.lane_context[SharedValues::UPDATE_APNS_CERTIFICATES_CUSTOM_VALUE] = "my_val"
# ENV prefixed vars are defined in env files
accountManager = CredentialsManager::AccountManager.new(user: ENV['ENV_APPLE_ID'])
Spaceship.login(accountManager.user, accountManager.password)
Spaceship.client.team_id = ENV['ENV_TEAM_ID']
# Save env variables
saved_pem_app_identifier = ENV['PEM_APP_IDENTIFIER']
saved_pem_file_name = ENV['PEM_FILE_NAME']
# List apps on Dev Portal
apps = Spaceship.app.all
apps.each do |app|
ENV['PEM_APP_IDENTIFIER'] = app.bundle_id
if app.bundle_id.include? '*'
puts "Skipping pem for Bundle ID: #{app.bundle_id}"
next
end
ENV['PEM_FILE_NAME'] = "production_#{app.bundle_id}"
puts "Running pem for Bundle ID: #{app.bundle_id}"
attempt_count = 1
begin
Fastlane::Actions::PemAction.run(params)
rescue
attempt_count += 1
if attempt_count < 10
puts "Retrying to pem. Attempt # #{attempt_count}..."
retry
else
raise
end
end
end
# Restore env variables
ENV['PEM_APP_IDENTIFIER'] = saved_pem_app_identifier
ENV['PEM_FILE_NAME'] = saved_pem_file_name
end
#####################################################
# @!group Documentation
#####################################################
def self.description
# "A short description with <= 80 characters of what this action does"
"Update all APNS certificates"
end
def self.details
# Optional:
# this is your change to provide a more detailed description of this action
"You can use this action to update push certificates for all your apps."
end
def self.available_options
# Define all options your action supports.
Fastlane::Actions::PemAction.available_options
end
def self.output
# Define the shared values you are going to provide
# Example
# [
# ['UPDATE_APNS_CERTIFICATES_CUSTOM_VALUE', 'A description of what this value contains']
# ]
end
def self.return_value
# If you method provides a return value, you can describe here what it does
end
def self.authors
# So no one will ever forget your contribution to fastlane :) You are awesome btw!
["realf"]
end
def self.is_supported?(platform)
# you can do things like
#
# true
#
# platform == :ios
#
# [:ios, :mac].include?(platform)
#
platform == :ios
end
end
end
end
Could you try the latest spaceship release?
@KrauseFx Since this is a production I cannot do it right now (we have a schedule for this procedure) but when I can I will update the issue. Thanks.
Sounds good :+1:
This issue was migrated to https://github.com/fastlane/fastlane/issues/2038. Please post all further comments there.
fastlane
is now a mono repo, you can read more about the change in our blog post. All tools are now available in the fastlane main repo :rocket:
I am trying to update APNS certificates with pem for all apps on team's Apple Developer Portal (over 300 apps for now). After successfull updating several certificates Spaceship fails with error:
Crash report id:
dbcad4da2142382a16f5382496a86ad6