add drone.star
Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
185
.drone.star
Normal file
185
.drone.star
Normal file
@@ -0,0 +1,185 @@
|
||||
def main(ctx):
|
||||
return [
|
||||
stepPR("amd64", "weirdradio"),
|
||||
stepPR("arm64", "weirdradio"),
|
||||
stepMergeMaster("amd64", "weirdradio"),
|
||||
stepMergeMaster("arm64", "weirdradio"),
|
||||
stepBuildWeekly("amd64", "weirdradio"),
|
||||
stepBuildWeekly("arm64", "weirdradio"),
|
||||
|
||||
notify(ctx),
|
||||
]
|
||||
|
||||
def notify(ctx):
|
||||
return {
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": "matrix-notifications",
|
||||
"clone": {
|
||||
"disable": True,
|
||||
},
|
||||
"steps": [
|
||||
{
|
||||
"name": "notify",
|
||||
"image": "plugins/matrix",
|
||||
"settings": {
|
||||
"homeserver": {
|
||||
"from_secret": "matrix-homeserver"
|
||||
},
|
||||
"roomid": {
|
||||
"from_secret": "matrix-room"
|
||||
},
|
||||
"username": {
|
||||
"from_secret": "matrix-user"
|
||||
},
|
||||
"password": {
|
||||
"from_secret": "matrix-password"
|
||||
}
|
||||
}
|
||||
},
|
||||
],
|
||||
"depends_on": [
|
||||
"docker-build-motsognir-amd64",
|
||||
"docker-build-motsognir-arm64",
|
||||
"docker-build-webtest-amd64",
|
||||
"docker-build-webtest-arm64",
|
||||
"docker-build-unbound-amd64",
|
||||
"docker-build-unbound-arm64",
|
||||
|
||||
"docker-publish-motsognir-amd64",
|
||||
"docker-publish-motsognir-arm64",
|
||||
"docker-publish-webtest-amd64",
|
||||
"docker-publish-webtest-arm64",
|
||||
"docker-publish-unbound-amd64",
|
||||
"docker-publish-unbound-arm64",
|
||||
|
||||
"docker-publish-weekly-motsognir-amd64",
|
||||
"docker-publish-weekly-motsognir-arm64",
|
||||
"docker-publish-weekly-webtest-amd64",
|
||||
"docker-publish-weekly-webtest-arm64",
|
||||
"docker-publish-weekly-unbound-amd64",
|
||||
"docker-publish-weekly-unbound-arm64",
|
||||
],
|
||||
"trigger": {
|
||||
"ref": [
|
||||
"refs/heads/master",
|
||||
"refs/heads/release*",
|
||||
"refs/tags/**",
|
||||
"refs/pull/**",
|
||||
],
|
||||
"status": [
|
||||
"failure",
|
||||
"success",
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
def stepPR(arch, path):
|
||||
return {
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": "docker-build-%s-%s" % (path, arch),
|
||||
"platform": {
|
||||
"os": "linux",
|
||||
"arch": arch,
|
||||
},
|
||||
"steps": [
|
||||
{
|
||||
"name": "build-image-%s-%s" % (path, arch),
|
||||
"image": "plugins/docker",
|
||||
"settings": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"repo": "dragonchaser/%s" % (path),
|
||||
"dry_run": "true",
|
||||
"tag": "latest-%s" % (arch),
|
||||
}
|
||||
},
|
||||
],
|
||||
"trigger": {
|
||||
"ref": [
|
||||
"refs/pull/**",
|
||||
],
|
||||
"status": [
|
||||
"success",
|
||||
"failure"
|
||||
]
|
||||
},
|
||||
}
|
||||
|
||||
def stepMergeMaster(arch, path):
|
||||
return {
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": "docker-publish-%s-%s" % (path, arch),
|
||||
"platform": {
|
||||
"os": "linux",
|
||||
"arch": arch,
|
||||
},
|
||||
"steps": [
|
||||
{
|
||||
"name": "build-and-publish-image-%s-%s" % (path, arch),
|
||||
"image": "plugins/docker",
|
||||
"settings": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"repo": "dragonchaser/%s" % (path),
|
||||
"dry_run": "false",
|
||||
"tag": "latest-%s" % (arch),
|
||||
"username": {
|
||||
"from_secret": "dockerhub-user"
|
||||
},
|
||||
"password": {
|
||||
"from_secret": "dockerhub-password"
|
||||
}
|
||||
}
|
||||
},
|
||||
],
|
||||
"trigger": {
|
||||
"ref": [
|
||||
"refs/heads/master",
|
||||
],
|
||||
"status": [
|
||||
"success",
|
||||
"failure"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
def stepBuildWeekly(arch, path):
|
||||
return {
|
||||
"kind": "pipeline",
|
||||
"type": "docker",
|
||||
"name": "docker-publish-weekly-%s-%s" % (path, arch),
|
||||
"platform": {
|
||||
"os": "linux",
|
||||
"arch": arch,
|
||||
},
|
||||
"steps": [
|
||||
{
|
||||
"name": "build-and-publish-image-%s-%s" % (path, arch),
|
||||
"image": "plugins/docker",
|
||||
"settings": {
|
||||
"dockerfile": "Dockerfile",
|
||||
"repo": "dragonchaser/%s" % (path),
|
||||
"dry_run": "false",
|
||||
"tag": "latest-%s" % (arch),
|
||||
"username": {
|
||||
"from_secret": "dockerhub-user"
|
||||
},
|
||||
"password": {
|
||||
"from_secret": "dockerhub-password"
|
||||
}
|
||||
}
|
||||
},
|
||||
],
|
||||
"trigger": {
|
||||
"ref": [
|
||||
"refs/heads/master",
|
||||
],
|
||||
"event": [
|
||||
"cron"
|
||||
],
|
||||
"cron": [
|
||||
"weekly"
|
||||
]
|
||||
},
|
||||
}
|
||||
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
**/*.json
|
||||
node_modules
|
||||
node_modules
|
||||
.drone.yml
|
||||
Reference in New Issue
Block a user