Mercurial > public > mercurial-scm > hg
comparison contrib/automation/hgautomation/aws.py @ 43018:d1d919f679f7
automation: support and use Debian Buster by default
While Debian Buster (Debian 10) was released in July, the
AWS AMIs were not published until mid September.
This commit teaches the automation system to create AMIs for
Debian Buster. Since Debian Buster is the new stable Debian
release, we make it the default distribution for automation.
Differential Revision: https://phab.mercurial-scm.org/D6917
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sun, 29 Sep 2019 11:29:25 -0700 |
parents | 6952d42f9158 |
children | 2372284d9457 |
comparison
equal
deleted
inserted
replaced
43017:6952d42f9158 | 43018:d1d919f679f7 |
---|---|
52 } | 52 } |
53 | 53 |
54 | 54 |
55 AMAZON_ACCOUNT_ID = '801119661308' | 55 AMAZON_ACCOUNT_ID = '801119661308' |
56 DEBIAN_ACCOUNT_ID = '379101102735' | 56 DEBIAN_ACCOUNT_ID = '379101102735' |
57 DEBIAN_ACCOUNT_ID_2 = '136693071363' | |
57 UBUNTU_ACCOUNT_ID = '099720109477' | 58 UBUNTU_ACCOUNT_ID = '099720109477' |
58 | 59 |
59 | 60 |
60 WINDOWS_BASE_IMAGE_NAME = 'Windows_Server-2019-English-Full-Base-2019.07.12' | 61 WINDOWS_BASE_IMAGE_NAME = 'Windows_Server-2019-English-Full-Base-2019.07.12' |
61 | 62 |
805 print('image %s available as %s' % (image.id, image.name)) | 806 print('image %s available as %s' % (image.id, image.name)) |
806 | 807 |
807 return image | 808 return image |
808 | 809 |
809 | 810 |
810 def ensure_linux_dev_ami(c: AWSConnection, distro='debian9', prefix='hg-'): | 811 def ensure_linux_dev_ami(c: AWSConnection, distro='debian10', prefix='hg-'): |
811 """Ensures a Linux development AMI is available and up-to-date. | 812 """Ensures a Linux development AMI is available and up-to-date. |
812 | 813 |
813 Returns an ``ec2.Image`` of either an existing AMI or a newly-built one. | 814 Returns an ``ec2.Image`` of either an existing AMI or a newly-built one. |
814 """ | 815 """ |
815 ec2client = c.ec2client | 816 ec2client = c.ec2client |
820 if distro == 'debian9': | 821 if distro == 'debian9': |
821 image = find_image( | 822 image = find_image( |
822 ec2resource, | 823 ec2resource, |
823 DEBIAN_ACCOUNT_ID, | 824 DEBIAN_ACCOUNT_ID, |
824 'debian-stretch-hvm-x86_64-gp2-2019-09-08-17994', | 825 'debian-stretch-hvm-x86_64-gp2-2019-09-08-17994', |
826 ) | |
827 ssh_username = 'admin' | |
828 elif distro == 'debian10': | |
829 image = find_image( | |
830 ec2resource, | |
831 DEBIAN_ACCOUNT_ID_2, | |
832 'debian-10-amd64-20190909-10', | |
825 ) | 833 ) |
826 ssh_username = 'admin' | 834 ssh_username = 'admin' |
827 elif distro == 'ubuntu18.04': | 835 elif distro == 'ubuntu18.04': |
828 image = find_image( | 836 image = find_image( |
829 ec2resource, | 837 ec2resource, |