File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
vendor/gems/codedeploy-commands-1.0.0/lib/aws/plugins Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 55:program_name : codedeploy-agent
66:root_dir : ' /opt/codedeploy-agent/deployment-root'
77:verbose : false
8- :version_dir : ' /opt/codedeploy-agent/'
98:wait_between_runs : 1
109:proxy_uri:
Original file line number Diff line number Diff line change @@ -4,19 +4,28 @@ class DeployAgentVersion < Seahorse::Client::Plugin
44 class Handler < Seahorse ::Client ::Handler
55 def initialize ( handler = nil )
66 @handler = handler
7- file_path = File . join ( ProcessManager :: Config . config [ :version_dir ] , '.version' )
7+ file_path = get_version_tracking_file
88 if File . exist? ( file_path )
99 @agent_version ||= File . read ( file_path ) . split ( ': ' ) . last . strip
1010 else
1111 @agent_version ||= "UNKNOWN_VERSION"
12- log ( :warn , "Version tracking file doesn't exist in directory #{ file_path } " )
12+ log ( :warn , "Version tracking file either does not exist or cannot be read. " )
1313 end
1414 end
1515
1616 def call ( context )
1717 context . http_request . headers [ 'x-amz-codedeploy-agent-version' ] = @agent_version
1818 @handler . call ( context )
1919 end
20+
21+ def get_version_tracking_file
22+ version_dir = ProcessManager ::Config . config [ :root_dir ]
23+ if version_dir . eql? 'Amazon/CodeDeploy'
24+ file_path = File . join ( version_dir , '.version' )
25+ else
26+ file_path = File . join ( version_dir , '..' , '.version' )
27+ end
28+ end
2029
2130 private
2231 def log ( severity , message )
You can’t perform that action at this time.
0 commit comments