123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- import os
- import logging
- logging.basicConfig(level=logging.INFO,
- format='%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s',
- datefmt='%a, %d %b %Y %H:%M:%S')
- server_group_id_list = ["sgp-l2k0p33e470vfmj538"]
- clb_id_list = ["lb-bp1mfk1gmd47twfh6bgwv", "lb-bp1jtzhp9krunyv3mim2q", "lb-bp1jijiyb925dk26ofm8h","lb-bp19a14ptmw1b7nwejvej","lb-bp15xf7asp620927z3lgr","lb-bp1i24x4sdfjbbuo8n1be","lb-bp153yk5n4szt6q8wzloy","lb-bp1s5c004pwnfu1beebye"]
- apps = 'piaoquan-gateway'
- repository = 'registry-vpc.cn-hangzhou.aliyuncs.com/stuuudy/{}'
- registry = 'registry-vpc.cn-hangzhou.aliyuncs.com/stuuudy/{}:{}'
- port = "9000"
- clb_client_params = {
- 'access_key_id': 'LTAIuPbTPL3LDDKN',
- 'access_key_secret': 'ORcNedKwWuwVtcq4IRFtUDZgS0b1le',
- 'region_id': 'cn-hangzhou'
- }
- alb_client_params = {
- 'access_key_id': 'LTAI5tASD5yEZLeC8ffmNebY',
- 'access_key_secret': '1PtsFRdp8viJmI78lEhNZR8MezWZBq',
- 'endpoint': 'alb-vpc.cn-hangzhou.aliyuncs.com',
- 'region_id': 'cn-hangzhou'
- }
- ecs_client_params = {
- 'access_key_id': 'LTAI4GBWbFvvXoXsSVBe1o9f',
- 'access_key_secret': 'kRAikWitb4kDxaAyBqNrmLmllMEDO3',
- 'region_id': 'cn-hangzhou'
- }
- docker_config = {
- 'username': 'stuuudys',
- 'password': 'Qingqu@2019',
- 'registry': 'registry-vpc.cn-hangzhou.aliyuncs.com'
- }
- instance_config_j_alb = {
-
- 'image_id': 'm-bp1e7t7odil9c8kqsm10',
-
- 'instance_type': 'ecs.c6.xlarge',
-
- 'vswitch_id': 'vsw-bp1ssuwxyrt0p17ceeir0',
-
- 'security_group_id': 'sg-bp1irhrkr4vfj272hk4y',
-
- 'disk_size': '200',
-
- 'instance_name': 'gateway-alb-[1,2]',
-
- 'zone_id': 'cn-hangzhou-j',
-
- 'disk_category': 'cloud_essd',
-
- 'key_pair_name': 'stuuudy',
-
- 'tags': [{"Key": "ecs", "Value": "gateway.prod"},{"Key": "o11y.aliyun.dev/prod", "Value": "gateway"}]
- }
- instance_config_j_clb = {
-
- 'image_id': 'm-bp1e7t7odil9c8kqsm10',
-
- 'instance_type': 'ecs.c6.xlarge',
-
- 'vswitch_id': 'vsw-bp1ssuwxyrt0p17ceeir0',
-
- 'security_group_id': 'sg-bp1irhrkr4vfj272hk4y',
-
- 'disk_size': '200',
-
- 'instance_name': 'gateway-prod-[1,2]',
-
- 'zone_id': 'cn-hangzhou-j',
-
- 'disk_category': 'cloud_essd',
-
- 'key_pair_name': 'stuuudy',
-
- 'tags': [{"Key": "ecs", "Value": "gateway.prod"},{"Key": "o11y.aliyun.dev/prod", "Value": "gateway"}]
- }
- start_sh_dir = os.path.dirname(os.path.realpath(__file__))
- start_sh_filename = 'gateway_start.sh'
- with open(file=os.path.join(start_sh_dir, start_sh_filename), mode='r', encoding='utf-8') as rf:
- file_content = rf.read()
-
- start_sh = {
- 'target_dir': '/home/gateway_server_sh',
- 'name': start_sh_filename,
- 'content': file_content,
- }
|