initialize

in lib/instance_agent/plugins/codedeploy/hook_executor.rb [78:109]


        def initialize(arguments = {})
          
          raise "Lifecycle Event Required " if arguments[:lifecycle_event].nil?
          raise "Deployment ID required " if arguments[:deployment_id].nil?
          raise "Deployment Root Directory Required " if arguments[:deployment_root_dir].nil?
          raise "App Spec Path Required " if arguments[:app_spec_path].nil?
          raise "Application name required" if arguments[:application_name].nil?
          raise "Deployment Group name required" if arguments[:deployment_group_name].nil?
          raise "Deployment creator required" if arguments[:deployment_creator].nil?
          raise "Deployment type required" if arguments[:deployment_type].nil?
          @lifecycle_event = arguments[:lifecycle_event]
          @deployment_id = arguments[:deployment_id]
          @application_name = arguments[:application_name]
          @deployment_group_name = arguments[:deployment_group_name]
          @deployment_group_id = arguments[:deployment_group_id]
          @deployment_creator = arguments[:deployment_creator]
          @deployment_type = arguments[:deployment_type]
          @current_deployment_root_dir = arguments[:deployment_root_dir]
          select_correct_deployment_root_dir(arguments[:deployment_root_dir], arguments[:last_successful_deployment_dir], arguments[:most_recent_deployment_dir])
          return if @deployment_root_dir.nil?
          @deployment_archive_dir = File.join(@deployment_root_dir, 'deployment-archive')
          @app_spec_path = arguments[:app_spec_path]
          parse_app_spec
          @hook_logging_mutex = Mutex.new
          @script_log = ScriptLog.new
          @child_envs={'LIFECYCLE_EVENT' => @lifecycle_event.to_s,
                      'DEPLOYMENT_ID'   => @deployment_id.to_s,
                      'APPLICATION_NAME' => @application_name,
                      'DEPLOYMENT_GROUP_NAME' => @deployment_group_name,
                      'DEPLOYMENT_GROUP_ID' => @deployment_group_id}
        end