Created
July 1, 2019 14:00
-
-
Save marcomorain/3e0e987670c30700305e4568d79b33af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc 'Renew push certifications and store them on the server' | |
lane :renew_certificate do | |
fastlane_require 'spaceship' | |
config = whitelabel(type: :store, download: false) | |
# If we are at the limit of push certificates (2), then revoke | |
# the oldest. | |
Spaceship::Portal.login | |
existing_certificates = Spaceship::Portal.certificate.production_push.all | |
.select {|c| c.owner_name == config.bundle_id } | |
.sort_by(&:expires) | |
if existing_certificates.count == 2 | |
UI.message "Found 2 existing push certificates; revoking the oldest" | |
existing_certificates.first.revoke! | |
end | |
pem(force: true, new_profile: Proc.new { |pem| upload_pem(config, pem) }) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment