@@ -55,10 +55,11 @@ begin
55
55
install [--sanity-check] [--proxy http://hostname:port] <package-type>
56
56
--sanity-check [optional]
57
57
--proxy [optional]
58
- package-type: 'rpm', 'deb', or 'auto'
58
+ package-type: 'rpm', 'deb', 'debdpkg' or 'auto'
59
59
60
60
Installs fetches the latest package version of the specified type and
61
61
installs it. rpms are installed with yum; debs are installed using gdebi.
62
+ The 'debdpkg' option forces the installation of deb packages with the dpkg command.
62
63
63
64
This program is invoked automatically to update the agent once per day using
64
65
the same package manager the codedeploy-agent is initially installed with.
@@ -385,14 +386,33 @@ end
385
386
else
386
387
#use -n for non-interactive mode
387
388
#use -o to not overwrite config files unless they have not been changed
388
- install_cmd = [ '/usr/bin/gdebi' , '-n' , '-o' , 'Dpkg::Options::=--force-confdef' , '-o' , 'Dkpg ::Options::=--force-confold' ]
389
+ install_cmd = [ '/usr/bin/gdebi' , '-n' , '-o' , 'Dpkg::Options::=--force-confdef' , '-o' , 'Dpkg ::Options::=--force-confold' ]
389
390
install_from_s3 ( region , bucket , version_file_key , @type , install_cmd )
390
391
do_sanity_check ( '/usr/sbin/service' )
391
392
end
392
393
when 'zypper'
393
394
#use -n for non-interactive mode
394
395
install_cmd = [ '/usr/bin/zypper' , 'install' , '-n' ]
395
396
install_from_s3 ( region , bucket , version_file_key , 'rpm' , install_cmd )
397
+ when 'debdpkg'
398
+ running_agent = `dpkg -s codedeploy-agent`
399
+ running_agent_info = running_agent . split
400
+ version_index = running_agent_info . index ( 'Version:' )
401
+ if !version_index . nil?
402
+ running_version = running_agent_info [ version_index + 1 ]
403
+ else
404
+ running_version = "No running version"
405
+ end
406
+ @log . info ( "Running version " + running_version )
407
+ target_version = get_version_file_from_s3 ( region , bucket , version_file_key ) [ 'deb' ]
408
+ if target_version . include? running_version
409
+ @log . info ( 'Running version matches target version, skipping install' )
410
+ else
411
+ #use --force-confdef,confold to ignore existing config files
412
+ install_cmd = [ '/usr/bin/dpkg' , '--install' , '--force-confdef,confold' ]
413
+ install_from_s3 ( region , bucket , version_file_key , "deb" , install_cmd )
414
+ do_sanity_check ( '/usr/sbin/service' )
415
+ end
396
416
else
397
417
@log . error ( "Unsupported package type '#{ @type } '" )
398
418
exit ( 1 )
0 commit comments