summaryrefslogtreecommitdiffstats
path: root/.github/scripts/gen-docker-tags.py
blob: c45b991d90156a10f077225adea89dfbd3c236ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python3

import sys

github_event = sys.argv[1]
version = sys.argv[2]

REPO = 'netdata/netdata'

REPOS = (
    REPO,
    f'quay.io/{REPO}',
    f'ghcr.io/{REPO}',
)

match version:
    case '':
        tags = (f'{REPO}:test',)
    case 'nightly':
        tags = tuple([
            f'{r}:{t}' for r in REPOS for t in ('edge', 'latest')
        ])
    case _:
        v = f'v{version}'.split('.')

        tags = tuple([
            f'{r}:{t}' for r in REPOS for t in (
                v[0],
                '.'.join(v[0:2]),
                '.'.join(v[0:3]),
            )
        ])

print(','.join(tags))