Fastlane's PEM tool provides amazing capabilities for generating new push certificates when the old one will expire.
But what if you just want to just check the expiration date without making modifications? Or alert your team on Slack when the date is approaching?
This project is a fastlane plugin. To get started with fastlane-plugin-push_cert_alert
, add it to your project by running:
fastlane add_plugin push_cert_alert
Generate alerts for when a push certificate will expire soon, or has expired already.
If you already use get_push_certificate (pem) and slack actions somewhere in your lanes then you are already configured.
Runbundle exec fastlane action push_cert_alert
for more information.
Simply add check_push_certificate
to some lane:
lane :test do
check_push_certificate
end
And you will receive a Slack alert when your cert has expired (or expires soon):
An APNS push certificate expires in 30 days
Lane: test
Result: Error
App Identifier: com.company.name
Type: production
Expires at: 1955-11-05 11:11:11 UTC
Name: Apple Push Services
You can also add custom callbacks for the events if desired:
check_push_certificate(
active_days_limit: 60, # Default is 30
skip_slack: true, # Defaults to true
expires_soon: proc do |cert, days|
puts "#{days} days until #{cert.name} expires. Perhaps you should run `get_push_certificate` soon to upgrade your push services."
end,
expired: proc do
puts "🚨 DANGER - Our push cert is expired (or missing)!"
end
)
Integrate this lane with your other lanes and/or CI to be made aware early of any upcoming push certificate expiration.
Example Circle CI job which could be run with your daily builds
jobs:
push_cert_alert:
executor: my_executor
steps:
- checkout
- restore_cache
- install_bundles
- run: bundle exec fastlane YOUR LANE
Check out the example Fastfile
to see how to use this plugin. Try it by cloning the repo, running fastlane install_plugins
and bundle exec fastlane test
.
For any other issues and feedback about this plugin, please submit it to this repository.
If you have trouble using plugins, check out the Plugins Troubleshooting guide.
For more information about how the fastlane
plugin system works, check out the Plugins documentation.
fastlane is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out fastlane.tools.