115 lines
4.1 KiB
Plaintext
115 lines
4.1 KiB
Plaintext
def main(ctx):
|
|
archs = ["amd64" ]
|
|
flavours = [ "sqlite3", "mysql" ]
|
|
upstream_versions = [ "6.0", "7.0" ]
|
|
out = []
|
|
for flavour in flavours:
|
|
for ver in upstream_versions:
|
|
for arch in archs:
|
|
out += pipeline(flavour, arch, ver)
|
|
out += manifest(flavour, ver, archs)
|
|
return out
|
|
|
|
def pipeline(flavour, arch, ver):
|
|
out = [{
|
|
"kind": "pipeline",
|
|
"type": "docker",
|
|
"name": "zabbix-proxy-%s-%s-%s" % (flavour, ver, arch),
|
|
"platform": {
|
|
"arch": arch,
|
|
"os": "linux",
|
|
},
|
|
"steps": [{
|
|
"name": "build_on_push",
|
|
"image": "plugins/docker:linux-%s" % (arch),
|
|
"settings": {
|
|
"context": "src",
|
|
"dockerfile": "src/Dockerfile-%s" % (ver),
|
|
"build_args": [
|
|
"UPSTREAM_FLAVOUR=" + flavour,
|
|
"UPSTREAM_VERSION=" + ver
|
|
],
|
|
"username": {
|
|
"from_secret": "docker_username",
|
|
},
|
|
"password": {
|
|
"from_secret": "docker_password",
|
|
},
|
|
"registry": "docker.asperti.com",
|
|
"repo": "docker.asperti.com/paspo/zabbix-proxy-%s-mssql" % (flavour),
|
|
"tags": [
|
|
"%s-%s" % (ver, arch)
|
|
],
|
|
"auto_tag": False,
|
|
"force_tag": True,
|
|
"daemon_off": False,
|
|
},
|
|
}],
|
|
"trigger": {
|
|
"ref": [
|
|
"refs/heads/master",
|
|
"refs/tags/**",
|
|
],
|
|
}
|
|
}]
|
|
return out
|
|
|
|
def manifest(flavour, ver, archs):
|
|
commands = [
|
|
'echo "image: docker.asperti.com/paspo/zabbix-proxy-%s-mssql:%s" >> manifest-%s.tmpl' % (flavour, ver, flavour),
|
|
'echo "manifests:" >> manifest-%s.tmpl' % (flavour),
|
|
'echo "- image: docker.asperti.com/paspo/zabbix-proxy-%s-mssql:%s-amd64" >> manifest-%s.tmpl' % (flavour, ver, flavour),
|
|
'echo " platform:" >> manifest-%s.tmpl' % (flavour),
|
|
'echo " architecture: amd64" >> manifest-%s.tmpl' % (flavour),
|
|
'echo " os: linux" >> manifest-%s.tmpl' % (flavour),
|
|
'echo "- image: docker.asperti.com/paspo/zabbix-proxy-%s-mssql:%s-arm64" >> manifest-%s.tmpl' % (flavour, ver, flavour),
|
|
'echo " platform:" >> manifest-%s.tmpl' % (flavour),
|
|
'echo " architecture: arm64" >> manifest-%s.tmpl' % (flavour),
|
|
'echo " variant: v8" >> manifest-%s.tmpl' % (flavour),
|
|
'echo " os: linux" >> manifest-%s.tmpl' % (flavour),
|
|
'echo "- image: docker.asperti.com/paspo/zabbix-proxy-%s-mssql:%s-arm" >> manifest-%s.tmpl' % (flavour, ver, flavour),
|
|
'echo " platform:" >> manifest-%s.tmpl' % (flavour),
|
|
'echo " architecture: arm" >> manifest-%s.tmpl' % (flavour),
|
|
'echo " variant: v7" >> manifest-%s.tmpl' % (flavour),
|
|
'echo " os: linux" >> manifest-%s.tmpl' % (flavour),
|
|
]
|
|
|
|
return [{
|
|
"kind": "pipeline",
|
|
"type": "docker",
|
|
"name": "manifest-%s-%s" % (flavour, ver),
|
|
"platform": {
|
|
"arch": archs[0],
|
|
"os": "linux",
|
|
},
|
|
"steps": [{
|
|
"name": "generate",
|
|
"image": "alpine",
|
|
"commands": commands,
|
|
},{
|
|
"name": "manifest",
|
|
"image": "plugins/manifest",
|
|
"settings": {
|
|
"spec": "manifest-%s.tmpl" % (flavour),
|
|
"username": {
|
|
"from_secret": "docker_username",
|
|
},
|
|
"password": {
|
|
"from_secret": "docker_password",
|
|
},
|
|
"tags": [
|
|
ver
|
|
],
|
|
"ignore_missing": True,
|
|
"force_tag": True,
|
|
},
|
|
}],
|
|
"trigger": {
|
|
"ref": [
|
|
"refs/heads/master",
|
|
"refs/tags/**",
|
|
],
|
|
},
|
|
"depends_on": ["zabbix-proxy-%s-%s-%s" % (flavour, ver, arch) for arch in archs]
|
|
}]
|