init
This commit is contained in:
23
update.py
Executable file
23
update.py
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/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))
|
||||
Reference in New Issue
Block a user