Add drone + build motsognir
Some checks reported errors
continuous-integration/drone/pr Build was killed

Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
Christian Richter
2022-05-10 22:24:44 +02:00
parent 0e55852f7e
commit acb8e384e7
3 changed files with 77 additions and 36 deletions

View File

@@ -1,36 +1,76 @@
def main(ctx):
return [
step("amd64"),
step("arm64"),
]
def step(arch):
return {
"kind": "pipeline",
"name": "build-%s" % arch,
"steps": [
{
"name": "build",
"image": "plugins/docker",
"repo": "dragonchaser/motsognir",
"volumes": [
{
"name":"docker_sock",
"path":"/var/run/docker.sock"
}
],
"commands": [
"cd motsognir",
"docker build -t dragonchaser/motsognir:latest ."
]
}
],
"volumes": [
{
"name":"docker_sock",
"host": {
"path": "/var/run/docker.sock"
}
}
return [
stepPR("amd64"),
stepPR("arm64"),
stepMergeMaster("amd64"),
stepMergeMaster("arm64"),
]
}
def stepPR(arch):
return {
"kind": "pipeline",
"type": "docker",
"name": "docker-build-%s" % (arch),
"platform": {
"os": "linux",
"arch": arch,
},
"steps": [
{
"name": "build-and-push-image-%s" % (arch),
"image": "plugins/docker",
"settings": {
"dockerfile": "motsognir/Dockerfile",
"repo": "dragonchaser/motsognir",
"dry_run": "true",
"tag": "latest-%s" % (arch),
"username": {
"from_secret": "dockerhub-user"
},
"password": {
"from_secret": "dockerhub-password"
}
}
},
],
"trigger": {
"ref": [
"refs/pull/**",
],
},
}
def stepMergeMaster(arch):
return {
"kind": "pipeline",
"type": "docker",
"name": "docker-publish-%s" % (arch),
"platform": {
"os": "linux",
"arch": arch,
},
"steps": [
{
"name": "build-image-%s" % (arch),
"image": "plugins/docker",
"settings": {
"dockerfile": "motsognir/Dockerfile",
"repo": "dragonchaser/motsognir",
"dry_run": "true",
"tag": "latest-%s" % (arch),
"username": {
"from_secret": "dockerhub-user"
},
"password": {
"from_secret": "dockerhub-password"
}
}
},
],
"trigger": {
"ref": [
"refs/heads/master",
],
},
}