restebanez/agi — pull request #7 by restebanez (2012-05-18 18:17:10+00:00)
Title: Feature/merge pir iq

Hi,

This feature uses the app ec2_sg_to_authorize field to extract the medistrano project name and the medistrano stage name. Medistrano PIRs are always store in the bucket "columbo-portal-current" and the path: "#{medistrano_project}/IQ/#{medistrano_project}-#{medistrano_stage}-PIR.pdf"

When either ec2_sg_to_authorize isn't set or the Medistrano PIR doesn't exist in S3, a disable check box will show up in the deployments/new, with a proper warning message.

You can see quite a few changes in the Deployment model. Half of those changes were to organize the code in sections so it's more readable. For this implementation, i created two public methods that are well tested: get_medistrano_pir, that is used for deployments/new controller to check if the Medistrano PIR exists and it's readable, and save_iq_file that is call after saving the deployment.

A global flag for enable/disable this feature was created, You can find it in Application.rb: config.feature_merge_medistrano_pir_with_agi_iq_is_enable. This flag makes testing much easier so older tests don't break and gives the oportunity for the future to create a settings area where you enable and disable features easily.

If the 3rd party binary pdftk doesn't exist, Agi app will raise an error with a proper message at rails boot time.
Thanks,

Rodrigo