File tree Expand file tree Collapse file tree 2 files changed +6
-11
lines changed
lib/instance_agent/platform
vendor/gems/codedeploy-commands-1.0.0/lib/aws/plugins Expand file tree Collapse file tree 2 files changed +6
-11
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ def self.extract_tgz(bundle_file, dst)
33
33
def self . supports_process_groups? ( )
34
34
true
35
35
end
36
+
37
+ def self . codedeploy_version_file
38
+ File . join ( ProcessManager ::Config . config [ :root_dir ] , '..' )
39
+ end
36
40
37
41
private
38
42
def self . execute_tar_command ( cmd )
Original file line number Diff line number Diff line change @@ -4,28 +4,19 @@ class DeployAgentVersion < Seahorse::Client::Plugin
4
4
class Handler < Seahorse ::Client ::Handler
5
5
def initialize ( handler = nil )
6
6
@handler = handler
7
- file_path = get_version_tracking_file
7
+ file_path = File . expand_path ( File . join ( InstanceAgent :: Platform . util . codedeploy_version_file , '.version' ) )
8
8
if File . exist? ( file_path )
9
9
@agent_version ||= File . read ( file_path ) . split ( ': ' ) . last . strip
10
10
else
11
11
@agent_version ||= "UNKNOWN_VERSION"
12
- log ( :warn , "Version tracking file either does not exist or cannot be read." )
12
+ log ( :warn , "Version tracking file either does not exist or cannot be read in #{ file_path } ." )
13
13
end
14
14
end
15
15
16
16
def call ( context )
17
17
context . http_request . headers [ 'x-amz-codedeploy-agent-version' ] = @agent_version
18
18
@handler . call ( context )
19
19
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
29
20
30
21
private
31
22
def log ( severity , message )
You can’t perform that action at this time.
0 commit comments