24 lines
605 B
Python
Executable File
24 lines
605 B
Python
Executable File
#!/usr/bin/env python3
|
|
import re
|
|
from dxf import DXF
|
|
from os import environ
|
|
|
|
dxf = DXF('ghcr.io', "coder/coder")
|
|
dxf.authenticate(actions=["pull"])
|
|
tags = dxf.list_aliases()
|
|
tags = [tag for tag in tags if re.match(r"^v\d+\.\d+\.\d+$", tag)]
|
|
|
|
|
|
try:
|
|
local_dxf = DXF(environ['CI_REGISTRY'], environ['CI_PROJECT_PATH'])
|
|
local_dxf.authenticate(
|
|
environ['CI_REGISTRY_USER'], environ['CI_REGISTRY_PASSWORD'], actions=["pull"])
|
|
local_tags = local_dxf.list_aliases()
|
|
except:
|
|
local_tags = []
|
|
|
|
update_tags = set(tags) - set(local_tags)
|
|
update_tags.add('latest')
|
|
|
|
print(' '.join(update_tags))
|