HarrisKirk / blue-green-dreams

2 stars 1 forks source link

Add env and project to the linode switch #85

Open HarrisKirk opened 1 year ago

HarrisKirk commented 1 year ago

Use code similar to this (looks like linodes have the same "update" command as nodebalancers):

Use PROJECT_ACRONYM and use "global" as the environment (since it is global in scope)

def add_tags(nb_id, PROJECT_ACRONYM, env):
    cmd = [
        "linode-cli",
        "nodebalancers",
        "update",
        "--tags",
        f"project_{PROJECT_ACRONYM}",         
        "--tags",
        f"env_{env}",
        str(nb_id)
    ]
    json_object = execute_linode_cli(cmd)
    return

See also https://github.com/HarrisKirk/blue-green-dreams/blob/68496bb6583d86eca9eb950d9040e660a02e0ccc/gwa-deploy/util.py#L5

DONE = the env and project tags appear on the created switch