Skip to content

Instantly share code, notes, and snippets.

@circa10a
Last active January 16, 2019 13:55
Show Gist options
  • Save circa10a/fd05d1a964f212687c2d5b59d6c93542 to your computer and use it in GitHub Desktop.
Save circa10a/fd05d1a964f212687c2d5b59d6c93542 to your computer and use it in GitHub Desktop.
from pyouroboros import VERSION
import yaml
org = 'pyouroboros'
project = 'ouroboros'
namespace = f"{org}/{project}"
yaml_arr = []
tags = ['latest', VERSION]
# Docker image, arch, variant, os
archs = [('amd64', 'amd64', None, 'linux'),
('armel', 'arm', 'v6', 'linux'),
('armhf', 'arm', 'v7', 'linux'),
('arm64', 'arm64', 'v8', 'linux')]
for tag in tags:
yaml_doc = {}
yaml_doc['image'] = f"{namespace}:{tag}"
yaml_doc['manifests'] = []
for arch in archs:
arch_dict = {
'image': f"{namespace}:{tag}-{arch[0]}",
'platform': {
'architecture': arch[1],
'os': arch[3]
}
}
if arch[2]:
arch_dict['platform']['variant'] = arch[2]
yaml_doc['manifests'].append(arch_dict)
yaml_arr.append(yaml_doc)
with open(f"{org}-{project}.yaml", 'w') as yaml_file:
yaml.dump_all(yaml_arr, yaml_file, default_flow_style=False)
# image: pyouroboros/ouroboros:latest
# manifests:
# - image: pyouroboros/ouroboros:latest-amd64
# platform:
# architecture: amd64
# os: linux
# - image: pyouroboros/ouroboros:latest-armel
# platform:
# architecture: arm
# os: linux
# variant: v6
# - image: pyouroboros/ouroboros:latest-armhf
# platform:
# architecture: arm
# os: linux
# variant: v7
# - image: pyouroboros/ouroboros:latest-arm64
# platform:
# architecture: arm64
# os: linux
# variant: v8
# ---
# image: pyouroboros/ouroboros:0.5.0
# manifests:
# - image: pyouroboros/ouroboros:0.5.0-amd64
# platform:
# architecture: amd64
# os: linux
# - image: pyouroboros/ouroboros:0.5.0-armel
# platform:
# architecture: arm
# os: linux
# variant: v6
# - image: pyouroboros/ouroboros:0.5.0-armhf
# platform:
# architecture: arm
# os: linux
# variant: v7
# - image: pyouroboros/ouroboros:0.5.0-arm64
# platform:
# architecture: arm64
# os: linux
# variant: v8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment