An app I am building integrates with a 3rd party api. For access to this api it authenticates via oauth using the RSA-SHA1 signature method which requires a certificate file.
The app is continuously deployed on heroku (php) using codeship.
I don't want to check the certificate into source control for a variety of reasons but need a way to copy the certificate to the production dyno every time the app is deployed. This is because Heroku dynos are stateless so revert themselves when the app is deployed (as I understand it).
What is the best way to copy this certificate to my dyno? I thought of using a command like this but it fails to work:
heroku run "echo \"${CERTDATA}\" > ./storage/certs/my_cert.pem"
I could store the actual certificate data in an environment variable on Codeship so it would be always available.
Alternatively I could create the cert file in Codeship and then force add it to the git deployment to Heroku. Can anyone give any guidance here?